Commit 299a9db1 authored by Jan Kiene's avatar Jan Kiene
Browse files

run USAN + ASAN in one go + sanity check for SIDs

parent eedf4961
Loading
Loading
Loading
Loading
+19 −9
Original line number Diff line number Diff line
@@ -28,33 +28,43 @@ make IVAS_dec -j CLANG=1
cp IVAS_dec CLANG1/IVAS_dec
cp IVAS_cod_nosan CLANG1/IVAS_cod

exit_code_msan=0
exit_code_msan_no_stereo=0
exit_code_msan_stereo=0
echo "-------------- 1. Encoder + Msan decoder -------------- "
echo "-------------- 1.1 all DTX modes except stereo -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_stereo -U 0:20 $common_args || exit_code_msan=$?
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_no_stereo -U 0:20 $common_args || exit_code_msan_no_stereo=$?
echo "-------------- 1.2 stereo DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_stereo -U 40:60 $common_args || exit_code_msan=$?
scripts/IvasBuildAndRunChecks.py --checks CLANG1 -m $modes_stereo -U 40:60 $common_args || exit_code_msan_stereo=$?
# archive encoder logs separately
mkdir logs_enc logs_dec_msan
mv CLANG1/logs/*.enc.txt logs_enc/
mv CLANG1/logs/*.dec*.txt logs_dec_msan/

# sanity check: ensure that we have DTX frames in the cut bitstreams
grep_result=$(grep -r "Extracted 0 frames!" logs_enc/)
if [ "$grep_result" != "" ]; then
  echo "Some bitstreams did not contain any SID frame!"
  echo -e "Check the input signals and/or the VAD performance!\n"
  echo "$grep_result"
  exit 1
fi

# ASAN and USAN can be done in one go and decoder only
# copy encoder output from CLANG1 dir
mkdir CLANG2 CLANG3
cp -r CLANG1/enc CLANG2/enc
cp -r CLANG1/enc CLANG3/enc

# In this run, we can do all the dtx modes together - we only run the decoder, so no cutting of input files needed
# the script does no put the cut length into the bitstream name, so the decoder can find the existing bitstreams this way
modes_all=$(scripts/runIvasCodec.py -l | grep dtx)
exit_code_asan_usan=0
echo "-------------- 2. Asan + Usan decoder -------------- "
echo "-------------- 2.1 all DTX modes except stereo -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_no_stereo $common_args || exit_code_asan_usan=$?
echo "-------------- 2.2 stereo DTX modes -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_stereo $common_args || exit_code_asan_usan=$?
echo "-------------- 2. Asan + Usan decoder (all in one go) -------------- "
scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes_all $common_args || exit_code_asan_usan=$?
mv CLANG2/logs logs_dec_asan
mv CLANG3/logs logs_dec_usan

if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then
if [ $exit_code_msan_no_stereo -ne 0 ] || [ $exit_code_msan_stereo -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then
  echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles."
  exit 1
fi