summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2017-02-27 12:27:49 -0500
committerPaul Moore <paul@paul-moore.com>2017-02-27 12:27:49 -0500
commit7d3957986fbe5914ececc5a6acfeafdde66d3482 (patch)
treed32f16cecaa31a2cabb443303d6a3380fea5b07a
parent4e618d26c58e08b560d0ca894f3381c0dd5d514f (diff)
downloadlibseccomp-7d3957986fbe5914ececc5a6acfeafdde66d3482.tar.gz
tests: fix some problems with 'make distcheck'
This commit also renames some of the variables in the tests directory to better reflect their meaning. Signed-off-by: Paul Moore <paul@paul-moore.com>
-rwxr-xr-xtests/38-basic-pfc_coverage.sh3
-rw-r--r--tests/Makefile.am8
-rwxr-xr-xtests/regression10
3 files changed, 15 insertions, 6 deletions
diff --git a/tests/38-basic-pfc_coverage.sh b/tests/38-basic-pfc_coverage.sh
index 598a57d..d22947a 100755
--- a/tests/38-basic-pfc_coverage.sh
+++ b/tests/38-basic-pfc_coverage.sh
@@ -42,4 +42,5 @@ function verify_deps() {
verify_deps diff
# compare output to the known good output, fail if different
-./38-basic-pfc_coverage | diff -q 38-basic-pfc_coverage.pfc - > /dev/null
+./38-basic-pfc_coverage | \
+ diff -q ${srcdir:=.}/38-basic-pfc_coverage.pfc - > /dev/null
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 025dfdf..3251bf6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -159,18 +159,18 @@ EXTRA_DIST_TESTCFGS = \
37-sim-ipc_syscalls_be.tests \
38-basic-pfc_coverage.tests
-EXTRA_DIST_TESTBASIC = \
- 38-basic-pfc_coverage.sh
+EXTRA_DIST_TESTSCRIPTS = \
+ 38-basic-pfc_coverage.sh 38-basic-pfc_coverage.pfc
-EXTRA_DIST_TESTSCRIPTS = regression testdiff testgen
+EXTRA_DIST_TESTTOOLS = regression testdiff testgen
EXTRA_DIST_TESTVALGRIND = valgrind_test.supp
EXTRA_DIST = \
${EXTRA_DIST_TESTCFGS} \
${EXTRA_DIST_TESTPYTHON} \
- ${EXTRA_DIST_TESTBASIC} \
${EXTRA_DIST_TESTSCRIPTS} \
+ ${EXTRA_DIST_TESTTOOLS} \
${EXTRA_DIST_TESTVALGRIND}
nodist_00_test_SOURCES = 00-test.c
diff --git a/tests/regression b/tests/regression
index 55fcbf9..10d41a4 100755
--- a/tests/regression
+++ b/tests/regression
@@ -605,6 +605,7 @@ function run_test_bpf_sim() {
#
function run_test_basic() {
local rc
+ local cmd
# if the test is a script, only run it in native/c mode
if [[ $mode != "c" && $(echo "$2" | grep -q '.sh$') -eq 0 ]]; then
@@ -616,8 +617,15 @@ function run_test_basic() {
# print out the input test data to the log file
print_data "$1" "$2"
+ # check and adjust if we are doing a VPATH build
+ if [[ -x "./$2" ]]; then
+ cmd="./$2"
+ else
+ cmd="${srcdir}/$2"
+ fi
+
# run the command
- run_test_command "$1" "./$2" "" "" ""
+ run_test_command "$1" "$cmd" "" "" ""
rc=$?
if [[ $rc -ne 0 ]]; then
print_result $1 "FAILURE" "$2 rc=$rc"