I’m running valgrind along with ceedling as instructed by Toby Webb text. Everything works ok when tests pass. However, upon a test failure or upon detecting a memory leak, Ceedling throws an error.
> Shell executed command:
`valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=10 build/test/out/test_soc_soh_module/test_soc_soh_module.out`
> Produced output:
test_soc_soh_module.c:24:test_calculates_soc_correctly:FAIL: Expected 13 Was 1
-----------------------
1 Tests 1 Failures 0 Ignored
FAIL
==62521== Memcheck, a memory error detector
==62521== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==62521== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==62521== Command: build/test/out/test_soc_soh_module/test_soc_soh_module.out
==62521==
==62521==
==62521== HEAP SUMMARY:
==62521== in use at exit: 0 bytes in 0 blocks
==62521== total heap usage: 1 allocs, 1 frees, 4,096 bytes allocated
==62521==
==62521== All heap blocks were freed -- no leaks are possible
==62521==
==62521== For lists of detected and suppressed errors, rerun with: -s
==62521== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
> And terminated with exit code: [1]
🪲 ERROR: Exception raised in plugin `command_hooks` within build hook :post_test_fixture_execute
Plugin | CommandHooks > :post_test...
🧨 EXCEPTION: undefined method `split' for nil:NilClass
🌱 Ceedling could not complete operations because of errors
Plugin | CommandHooks > :post_error...
How can I fix this?
When I run the shell command independently, no errors are shown.
valgrind --track-origins=yes --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all --error-exitcode=10 build/test/out/test_soc_soh_module/test_soc_soh_module.out
==62928== Memcheck, a memory error detector
==62928== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==62928== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==62928== Command: build/test/out/test_soc_soh_module/test_soc_soh_module.out
==62928==
test_soc_soh_module.c:24:test_calculates_soc_correctly:FAIL: Expected 13 Was 1
-----------------------
1 Tests 1 Failures 0 Ignored
FAIL
==62928==
==62928== HEAP SUMMARY:
==62928== in use at exit: 0 bytes in 0 blocks
==62928== total heap usage: 1 allocs, 1 frees, 1,024 bytes allocated
==62928==
==62928== All heap blocks were freed -- no leaks are possible
==62928==
==62928== For lists of detected and suppressed errors, rerun with: -s
==62928== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
New contributor
Asith Warnakulasuriya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.