aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-05-31 09:05:00 +0200
committerGitHub <noreply@github.com>2023-05-31 09:05:00 +0200
commite14d0acbd45d120f6474d3673fa504f180aa73ce (patch)
treeae16c52c6347c6de59d9c4163a6b391c506831d6
parente17fa1259aa3b2fb4a6479188ac98fb826967848 (diff)
tests: add an option to force the overwrite of the unit tests results (#2001)
Usage: `FORCE_UPDATING_UTESTS_RESULTS=1 ./tests/do.sh`
-rwxr-xr-xtests/do.sh.in8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/do.sh.in b/tests/do.sh.in
index 131d78f2a..d9c568865 100755
--- a/tests/do.sh.in
+++ b/tests/do.sh.in
@@ -7,6 +7,11 @@ if [ "${NDPI_DISABLE_FUZZY}" = "1" ]; then
FUZZY_TESTING_ENABLED=0
fi
+FORCE_UPDATING_UTESTS_RESULTS=0
+if [ "${NDPI_FORCE_UPDATING_UTESTS_RESULTS}" = "1" ]; then
+ FORCE_UPDATING_UTESTS_RESULTS=1
+fi
+
#Remember: valgrind and *SAN are incompatible!
CMD_PREFIX="${CMD_PREFIX}"
if [ "${NDPI_TESTS_WINE}" = "1" ]; then
@@ -124,6 +129,9 @@ check_results() {
fi
RC=$(( RC + 1 ))
FAILURES+=("$f.out")
+ if [ $FORCE_UPDATING_UTESTS_RESULTS -eq 1 ]; then
+ cp /tmp/reader.$$.out result/$f.out
+ fi
fi
/bin/rm -f /tmp/reader.$$.out