From c2b5b71777138af1fb1bcd7aebe62fca11e856bb Mon Sep 17 00:00:00 2001 From: Steffen Dettmer Date: Thu, 9 Apr 2020 17:43:51 +0200 Subject: [PATCH] First few fixes for make check (#250) --- .gitignore | 1 + .travis.yml | 1 + test/Makefile.am | 20 ++++++++++++-------- test/functests.sh | 7 +++++++ test/testframe.sh | 4 +++- 5 files changed, 24 insertions(+), 9 deletions(-) create mode 100755 test/functests.sh diff --git a/.gitignore b/.gitignore index 62c0798..b2bb5ab 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ Makefile.in .libs/ *.l[ao] compile +test-driver diff --git a/.travis.yml b/.travis.yml index 4fcab33..c49ff11 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,3 +14,4 @@ script: - FAKETIME_COMPILE_CFLAGS="-DFORCE_MONOTONIC_FIX" make - cd test - make test + - make distcheck diff --git a/test/Makefile.am b/test/Makefile.am index f2257fd..7c4b98e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -3,8 +3,18 @@ AM_CPPFLAGS =-DFAKE_SLEEP -DFAKE_INTERNAL_CALLS -I@top_srcdir@/src AM_CFLAGS = AM_LDFLAGS = -bin_PROGRAMS = timetest +# functests.sh fail for me, test.sh hangs for me. +# TESTS = test.sh functests.sh +check_PROGRAMS = timetest timetest_SOURCES = timetest.c +check_SCRIPTS = functests.sh testframe.sh test.sh +EXTRA_DIST = $(check_SCRIPTS) \ + functests/common.inc \ + functests/dont_test_false.sh \ + functests/test_exclude_mono.sh \ + functests/test_null.sh \ + functests/test_true.sh \ + functests/test_walkone.sh if SOLARIS AM_CPPFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600 @@ -16,10 +26,4 @@ if !MACOS timetest_LDADD = -ldl -lm -lrt -lpthread endif -test: timetest functest - @echo - @./test.sh -# -# run functional tests -functest: - ./testframe.sh functests + diff --git a/test/functests.sh b/test/functests.sh new file mode 100755 index 0000000..067d422 --- /dev/null +++ b/test/functests.sh @@ -0,0 +1,7 @@ +#!/bin/sh +set -e +[ "${srcdir}" ] || srcdir=. + +# run functional tests +# cd "${srcdir}/" +${srcdir}/testframe.sh ${srcdir}/functests diff --git a/test/testframe.sh b/test/testframe.sh index 22975b6..444df47 100755 --- a/test/testframe.sh +++ b/test/testframe.sh @@ -6,6 +6,8 @@ # see README.testframe.txt for details. # +testframedir="${BASH_SOURCE%/*}" + # echo labelled error/warning message to stderr report() { @@ -33,7 +35,7 @@ run_testsuite() # add testsuite dir to PATH for convenience typeset dir=$(dirname $testsuite) PATH=$dir:$PATH - . testframe.inc + . $testframedir/testframe.inc if [ -f $dir/common.inc ]; then . $dir/common.inc fi