ModSecurity/test/test-suite.sh
Andrei Belov 0a85b599b6
Fix tests on FreeBSD
FreeBSD has different prefix for bash (which is non-standard shell there),
thus "make check-TESTS" actually was doing nothing:

$ gmake check-TESTS
(   0/  0/   0): test/test-cases/regression/issue-1591.json
(   0/  0/   0): test/test-cases/regression/issue-1785.json
(   0/  0/   0): test/test-cases/regression/issue-1812.json
(   0/  0/   0): test/test-cases/regression/issue-1831.json
(   0/  0/   0): test/test-cases/regression/issue-1844.json
(   0/  0/   0): test/test-cases/regression/issue-1850.json
[..]
Testsuite summary for modsecurity 3.0
2018-12-04 10:49:25 -03:00

25 lines
545 B
Bash
Executable File

#!/usr/bin/env bash
cd test 1> /dev/null
length=$(($#-1))
array=${@:1:$length}
PARAM=$array
FILE=${@: -1}
if [[ $FILE == *"test-cases/regression/"* ]]
then
AMOUNT=$(./regression_tests countall ../$FILE)
for i in `seq 1 $AMOUNT`; do
$VALGRIND $PARAM ./regression_tests ../$FILE:$i
if [ $? -eq 139 ]; then
echo ":test-result: FAIL segfault: ../$FILE:$i"
fi
echo $VALGRIND $PARAM ./regression_tests ../$FILE:$i
done;
else
$VALGRIND $PARAM ./unit_tests ../$FILE
fi
cd - 1> /dev/null