Skip to content

Commit

Permalink
tests: add an option to force the overwrite of the unit tests results (
Browse files Browse the repository at this point in the history
…#2001)

Usage: `FORCE_UPDATING_UTESTS_RESULTS=1 ./tests/do.sh`
  • Loading branch information
IvanNardi authored May 31, 2023
1 parent e17fa12 commit e14d0ac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/do.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e14d0ac

Please sign in to comment.