Skip to content

Commit ce9e880

Browse files
committed
ci: Stop if valgrind detects errors
* In CI all tests failed to run under valgrind since we compiled with ASAN * Tests should be compiled with ASAN/UBSAN unless they are being run under valgrind. * The way the tests were run meant that failing tests didn't fail the overall CI job.
1 parent 7b84950 commit ce9e880

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

.ci/ci

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,20 @@ make -C py
2020
./.ci/check-release-sigs
2121

2222
# Make build directories so we can do some static analysis
23+
# - prepare-tidy will create build dirs and more importantly the
24+
# compile_commands.json needed for clang-tidy
2325
make prepare-tidy
2426
./.ci/check-tidy
2527

2628
# Build and run Unit tests
27-
make -j8 unit-test SANITIZE=OFF
29+
make -j8 unit-test
2830
make -j8 run-unit-tests
2931
make -j8 run-rust-unit-tests
32+
33+
# Delete the build directories so that SANITIZE=OFF will take effect
34+
# Valgrind cannot run programs compiled with address sanitizing on.
35+
make clean
36+
make -j8 unit-test SANITIZE=OFF
3037
make -j8 run-valgrind-on-unit-tests
3138

3239
# BUild simulator

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ coverage: | build-build
105105
#./build/bin/test_ui_component_gestures;
106106
run-valgrind-on-unit-tests:
107107
$(MAKE) unit-test
108-
bash -c 'find build-build/bin/ -name "test_*" -exec valgrind --leak-check=yes --track-origins=yes {} \;'
108+
bash -ec 'for exe in build-build/bin/test_*; do valgrind --leak-check=yes --track-origins=yes --error-exitcode=1 --exit-on-first-error=yes $$exe; done'
109109
flash-dev-firmware:
110110
./py/load_firmware.py build/bin/firmware.bin --debug
111111
jlink-flash-bootloader-development: | build

0 commit comments

Comments
 (0)