summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2014-10-21 16:14:10 -0400
committerPaul Moore <pmoore@redhat.com>2014-10-21 16:14:10 -0400
commitb37a453dce194f79819f6955e32ff8043e38b797 (patch)
treea416003a56cf940694279ebb03417dc48e48e6b5
parent97e09041741edce5197dfb0cc43e3a3cb0d9f8f0 (diff)
downloadlibseccomp-b37a453dce194f79819f6955e32ff8043e38b797.tar.gz
tests: allow the regression test to run properly from 'make distcheck'
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rwxr-xr-xtests/regression12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/regression b/tests/regression
index 1d68ebc..428bdf2 100755
--- a/tests/regression
+++ b/tests/regression
@@ -594,7 +594,6 @@ function run_test_basic() {
#
function run_test_bpf_valgrind() {
local rc
- local testcmd
# we only support the native/c test mode here
if [[ $mode != "c" ]]; then
@@ -606,14 +605,13 @@ function run_test_bpf_valgrind() {
print_data "$1" "$2"
# build the command
- testcmd="$2"
testvalgrind="valgrind \
--tool=memcheck \
--error-exitcode=1 \
--leak-check=full \
--read-var-info=yes \
--track-origins=yes \
- --suppressions=valgrind_test.supp"
+ --suppressions=$basedir/valgrind_test.supp"
if [[ -n $logfile ]]; then
testvalgrind+=" --log-fd=$logfd"
fi
@@ -624,7 +622,7 @@ function run_test_bpf_valgrind() {
# run the command
exec 4>/dev/null
print_valgrind "$1"
- run_test_command "$1" "$testvalgrind --" "./$testcmd -b" 4 2
+ run_test_command "$1" "$testvalgrind --" "./$2 -b" 4 2
rc=$?
exec 4>&-
if [[ $rc -ne 0 ]]; then
@@ -760,7 +758,7 @@ function run_test() {
#
function run_tests() {
# loop through all test files
- for file in *.tests; do
+ for file in $basedir/*.tests; do
local testnum=1
local batch_requested=false
local batch_name=""
@@ -852,6 +850,10 @@ stats_success=0
stats_failure=0
stats_error=0
+# set the test root directory
+basedir=$(dirname $0)
+
+# parse the command line
while getopts "ab:gl:m:s:t:T:vh" opt; do
case $opt in
a)