# fail the ci job if any ctest test (or unit test) have failed
# fail the ci job if any ctest test (or unit test) have failed
-echo "Failed tests:"
-echo "Failed tests:"
-if grep -B 1 'Outcome:.*Failed' ${BUILD_DIR}/matlab_matfaust_test_output.html | sed -ne 's%.*Test case:.*<b>\(.*\)</b>.*%\1%p'; then exit 1; else if grep "Failure Summary:" ${BUILD_DIR}/matlab_matfaust_test_output.html; then echo "all ctest passed but some unit tests failed (look the junit report!)"; exit 2; else echo "(None) all tests passed"; exit 0;fi;fi
-if grep -B 1 'Outcome:.*Failed' ${BUILD_DIR}/matlab_matfaust_test_output.html | sed -ne 's%.*Test case:.*<b>\(.*\)</b>.*%\1%p'; then exit 1; else if grep "Failure Summary:" ${BUILD_DIR}/matlab_matfaust_test_output.html; then echo "all ctest passed but some unit tests failed (look the junit report!)"; exit 2; else echo "(None) all tests passed"; exit 0;fi;fi