aboutsummaryrefslogtreecommitdiff
path: root/tests/Makefile.am
blob: bf03ac7aa27a1524a12aa343024491f31c79d8ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-License-Identifier: LGPL-2.1-or-later

#
# This file is part of libgpiod.
#
# Copyright (C) 2017-2018 Bartosz Golaszewski <bartekgola@gmail.com>
#

AM_CFLAGS = -I$(top_srcdir)/include/ -include $(top_builddir)/config.h
AM_CFLAGS += -Wall -Wextra -g $(KMOD_CFLAGS) $(UDEV_CFLAGS)
AM_LDFLAGS = -pthread
LDADD = ../src/lib/libgpiod.la $(KMOD_LIBS) $(UDEV_LIBS)

check_PROGRAMS = gpiod-test

if WITH_INSTALL_TESTS
bin_PROGRAMS = $(check_PROGRAMS)
GPIOD_TOOLS_PATH=@prefix@/bin
else
noinst_PROGRAMS = $(check_PROGRAMS)
GPIOD_TOOLS_PATH="./../../src/tools"
endif
AM_CFLAGS += -DGPIOD_TOOLS_PATH=$(GPIOD_TOOLS_PATH)/

gpiod_test_SOURCES =	gpiod-test.c \
			gpiod-test.h \
			tests-chip.c \
			tests-ctxless.c \
			tests-event.c \
			tests-iter.c \
			tests-line.c \
			tests-misc.c

if WITH_TOOLS

gpiod_test_SOURCES +=	tests-gpiodetect.c \
			tests-gpiofind.c \
			tests-gpioget.c \
			tests-gpioinfo.c \
			tests-gpiomon.c \
			tests-gpioset.c

endif

check: check-am
	@echo " ********************************************************"
	@echo " * Tests have been built as tests/gpio-test.            *"
	@echo " *                                                      *"
	@echo " * They require a recent linux kernel version and the   *"
	@echo " * gpio-mockup module (must not be built-in).           *"
	@echo " *                                                      *"
	@echo " * Run the test executable with superuser privileges or *"
	@echo " * make sure /dev/gpiochipX files are readable and      *"
	@echo " * writable by normal users.                            *"
	@echo " ********************************************************"