Commit 548762f4 authored by Jan Kiene's avatar Jan Kiene
Browse files

check for sanitizer errors in the reports instead

parent 036b3200
Loading
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -202,15 +202,30 @@ stages:
    - make -j CLANG=$CLANG_NUM
    - testcase_timeout=$SELFTEST_SANITY_TIMEOUT
    - export UBSAN_OPTIONS=suppressions=scripts/ubsan.supp,report_error_type=1

    - exit_code20=0
    - exit_code10=0
    - exit_code5=0
    - errors20=0
    - errors10=0
    - errors5=0

    - if [ $CLANG_NUM -eq 1 ]; then sanitizer_type="MemorySanitizer"; elif [ $CLANG_NUM -eq 2 ]; then sanitizer_type="AddressSanitizer"; elif [ $CLANG_NUM -eq 3 ]; then sanitizer_type="UndefinedBehaviorSanitizer"; else echo "Wrong CLANG_NUM $CLANG_NUM given!"; exit 1; fi

    # ignore exit codes, instead search in the report for errors
    - python3 -m pytest $SELF_TEST_PRM_FILE -v --update_ref 1 -m create_ref --html=report-20ms.html --self-contained-html --junit-xml=report-junit-20ms.xml --testcase_timeout=$testcase_timeout --ref_encoder_path ./IVAS_cod --ref_decoder_path ./IVAS_dec || exit_code20=$?
    - errors20=$(cat report-20ms.html | grep -c "$sanitizer_type") || true

    - python3 -m pytest $SELF_TEST_PRM_FILE -v --html=report-5ms.html --self-contained-html --junit-xml=report-junit-5ms.xml --dut_fr 5 --decoder_only || exit_code5=$?
    - errors10=$(cat report-10ms.html | grep -c "$sanitizer_type") || true

    - python3 -m pytest $SELF_TEST_PRM_FILE -v --html=report-10ms.html --self-contained-html --junit-xml=report-junit-10ms.xml --dut_fr 10 --decoder_only || exit_code10=$?
    - errors5=$(cat report-5ms.html | grep -c "sanitizer_type") || true

    - if [ $exit_code20 -ne 0 ] || [ $exit_code10 -ne 0 ] || [ $exit_code5 -ne 0 ]; then exit 1; fi
    - if [ $errors20 -ne 0 ]; then echo "CLANG $sanitizer_type found errors in 20ms framesize decoding"; fi
    - if [ $errors10 -ne 0 ]; then echo "CLANG $sanitizer_type found errors in 10ms framesize decoding"; fi
    - if [ $errors5 -ne 0 ]; then echo "CLANG $sanitizer_type found errors in 5ms framesize decoding"; fi
    - if [ $errors20 -ne 0 ] || [ $errors10 -ne 0 ] || [ $errors5 -ne 0 ]; then exit 1; fi


# ---------------------------------------------------------------