summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRan Benita <ran234@gmail.com>2013-03-02 19:01:18 +0200
committerDaniel Stone <daniel@fooishbar.org>2013-03-18 22:20:04 +0000
commit79329e1022446cb8d13d12ca856951563b169668 (patch)
treec061027cd73549e6076af37e962c4da5a5df1299
parent14842d6dc911db0a30afff8c75a89d34390de2e9 (diff)
Don't try to build linux-specific tests on non-linux
Some tests use linux/input.h (and epoll), but we're building on some other kernels (e.g. debian freebsd). We could just copy the file but it's GPL. We could also skip the tests (exit code 77) but it doesn't really matter. Signed-off-by: Ran Benita <ran234@gmail.com>
-rw-r--r--Makefile.am20
-rw-r--r--configure.ac4
-rw-r--r--test/bench-key-proc.c1
3 files changed, 18 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 027fbf3..02a93b2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,36 +123,44 @@ TESTS = \
test/keysym \
test/filecomp \
test/rulescomp \
- test/state \
test/context \
test/rules-file \
test/stringcomp \
- test/keyseq \
test/log
TESTS_LDADD = libtest.la
test_keysym_LDADD = $(TESTS_LDADD)
test_filecomp_LDADD = $(TESTS_LDADD)
test_rulescomp_LDADD = $(TESTS_LDADD) -lrt
-test_state_LDADD = $(TESTS_LDADD)
test_context_LDADD = $(TESTS_LDADD)
test_rules_file_CFLAGS = $(AM_CFLAGS) -Wno-declaration-after-statement
test_rules_file_LDADD = $(TESTS_LDADD) -lrt
test_stringcomp_LDADD = $(TESTS_LDADD)
-test_keyseq_LDADD = $(TESTS_LDADD)
test_log_LDADD = $(TESTS_LDADD)
-test_interactive_LDADD = $(TESTS_LDADD)
test_rmlvo_to_kccgst_LDADD = $(TESTS_LDADD)
test_print_compiled_keymap_LDADD = $(TESTS_LDADD)
test_bench_key_proc_LDADD = $(TESTS_LDADD) -lrt
check_PROGRAMS = \
$(TESTS) \
- test/interactive \
test/rmlvo-to-kccgst \
test/print-compiled-keymap \
test/bench-key-proc
+if BUILD_LINUX_TESTS
+TESTS += \
+ test/state \
+ test/keyseq
+
+test_keyseq_LDADD = $(TESTS_LDADD)
+test_state_LDADD = $(TESTS_LDADD)
+test_interactive_LDADD = $(TESTS_LDADD)
+
+check_PROGRAMS += \
+ test/interactive
+
+endif BUILD_LINUX_TESTS
+
EXTRA_DIST = \
test/data
diff --git a/configure.ac b/configure.ac
index 1e8d539..7ecca9c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,6 +73,10 @@ fi
AC_CHECK_FUNCS([eaccess euidaccess])
+# Some tests use Linux-specific headers
+AC_CHECK_HEADER([linux/input.h])
+AM_CONDITIONAL(BUILD_LINUX_TESTS, [test "x$ac_cv_header_linux_input_h" = xyes])
+
XORG_TESTSET_CFLAG([BASE_CFLAGS], [-fvisibility=hidden])
# Define a configuration option for the XKB config root
diff --git a/test/bench-key-proc.c b/test/bench-key-proc.c
index 1144048..241c217 100644
--- a/test/bench-key-proc.c
+++ b/test/bench-key-proc.c
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <time.h>
-#include <linux/input.h>
#include "test.h"