diff options
author | Alfredo Cardigliano <alfredo.cardigliano@gmail.com> | 2020-10-12 12:11:35 +0200 |
---|---|---|
committer | Alfredo Cardigliano <alfredo.cardigliano@gmail.com> | 2020-10-12 12:11:35 +0200 |
commit | 2051e51380e9a54cdaf5e868a6d93d7ed6d42653 (patch) | |
tree | 3652fe7f8514784f7a771b1496020c064e6e3755 | |
parent | c92e0d13fde84b5e8d8c15b45d3ee23bfef816cd (diff) |
Decoupled fuzzy and unit tests
-rw-r--r-- | .travis.yml | 1 | ||||
-rwxr-xr-x | tests/do-unit.sh | 32 | ||||
-rwxr-xr-x | tests/do.sh | 23 |
3 files changed, 33 insertions, 23 deletions
diff --git a/.travis.yml b/.travis.yml index e77630d19..ddf6c9d37 100644 --- a/.travis.yml +++ b/.travis.yml @@ -197,6 +197,7 @@ script: #after_script: - cd tests - ./do.sh + - ./do-unit.sh #after_success: #- cd ${TRAVIS_BUILD_DIR} diff --git a/tests/do-unit.sh b/tests/do-unit.sh new file mode 100755 index 000000000..937be26ff --- /dev/null +++ b/tests/do-unit.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +cd "$(dirname "${0}")" + +UNIT="./unit/unit" + +RC=0 + +check_unit() { + + case "$CXXFLAGS" in + # Skipping tests with sanitizer enabled due to use-of-uninitialized-value in json-c + *sanitize* ) + echo "Skipping unit tests for this environment" + return + ;; + * ) + echo "" + echo "Running unit tests.." + ;; + esac + + $UNIT + UNIT_RC=$? + if [ $UNIT_RC -ne 0 ]; then + RC=1 + fi +} + +check_unit + +exit $RC diff --git a/tests/do.sh b/tests/do.sh index c488db319..707744064 100755 --- a/tests/do.sh +++ b/tests/do.sh @@ -3,7 +3,6 @@ cd "$(dirname "${0}")" READER="../example/ndpiReader -p ../example/protos.txt -c ../example/categories.txt" -UNIT="./unit/unit" RC=0 PCAPS=`cd pcap; /bin/ls *.pcap` @@ -46,30 +45,8 @@ check_results() { done } -check_unit() { - - case "$CXXFLAGS" in - # Skipping tests with sanitizer enabled due to use-of-uninitialized-value in json-c - *sanitize* ) - echo "Skipping unit tests for this environment" - return - ;; - * ) - echo "" - echo "Running unit tests.." - ;; - esac - - $UNIT - UNIT_RC=$? - if [ $UNIT_RC -ne 0 ]; then - RC=1 - fi -} - fuzzy_testing build_results check_results -check_unit exit $RC |