Decoupled fuzzy and unit tests

This commit is contained in:
Alfredo Cardigliano
2020-10-12 12:11:35 +02:00
parent c92e0d13fd
commit 2051e51380
3 changed files with 33 additions and 23 deletions
+1
View File
@@ -197,6 +197,7 @@ script:
#after_script:
- cd tests
- ./do.sh
- ./do-unit.sh
#after_success:
#- cd ${TRAVIS_BUILD_DIR}
+32
View File
@@ -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
-23
View File
@@ -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