File: test-suite.sh

package info (click to toggle)
modsecurity 3.0.9-1%2Bdeb12u1
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 39,148 kB
  • sloc: cpp: 27,506; ansic: 15,067; sh: 5,355; python: 2,934; yacc: 2,927; makefile: 1,490; lex: 1,359; php: 42; perl: 36
file content (40 lines) | stat: -rwxr-xr-x 980 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/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)
    RET=$?
    if [ $RET -ne 0 ]; then
        echo ":test-result: SKIP: json is not enabled. (regression/$RET) ../$FILE:$i"
        exit 0
    fi

    for i in `seq 1 $AMOUNT`; do
        $VALGRIND $PARAM ./regression_tests ../$FILE:$i
        RET=$?
        if [ $RET -ne 0 ]; then
            echo ":test-result: FAIL possible segfault/$RET: ../$FILE:$i"
        fi
        echo $VALGRIND $PARAM ./regression_tests ../$FILE:$i
    done;
else
      $VALGRIND $PARAM ./unit_tests ../$FILE
      RET=$?
      if [ $RET -eq 127 ]
      then
          echo ":test-result: SKIP: json is not enabled. (unit/$RET) ../$FILE:$i"
      elif [ $RET -ne 0 ]
      then
          echo ":test-result: FAIL possible segfault: (unit/$RET) ../$FILE:$i"
      fi
fi

cd - 1> /dev/null