Skip to content

Commit 30a7a50

Browse files
authored
Merge pull request #1292 from NickeZ/nickez/valgrind-stop-on-fail
ci: Stop if valgrind detects errors
2 parents 2c73796 + ce9e880 commit 30a7a50

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
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

test/unit-test/test_memory_functional.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,9 @@ static void _test_memory_attestation(void** state)
107107
uint8_t expected_pubkey[64];
108108
memset(expected_pubkey, 0x55, sizeof(expected_pubkey));
109109
uint8_t expected_certificate[64];
110-
memset(expected_pubkey, 0x66, sizeof(expected_certificate));
110+
memset(expected_certificate, 0x66, sizeof(expected_certificate));
111111
uint8_t expected_root_pubkey_identifier[32];
112-
memset(expected_pubkey, 0x77, sizeof(expected_root_pubkey_identifier));
112+
memset(expected_root_pubkey_identifier, 0x77, sizeof(expected_root_pubkey_identifier));
113113

114114
uint8_t pubkey[64];
115115
uint8_t certificate[64];

0 commit comments

Comments
 (0)