From 7d3957986fbe5914ececc5a6acfeafdde66d3482 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Mon, 27 Feb 2017 12:27:49 -0500 Subject: 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 --- tests/38-basic-pfc_coverage.sh | 3 ++- tests/Makefile.am | 8 ++++---- tests/regression | 10 +++++++++- 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" -- cgit v1.2.1