git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v4 1/8] test-lib: enable MALLOC_* for the actual tests

From
Thomas Rast <trast@inf.ethz.ch>
Date
Jun 23, 2013, 18:12 UTC
Message-ID
<d2b5d1eac050319b4ed24506e3d8b1a07d88aa32.1372010917.git.trast@inf.ethz.ch>
In-Reply-To
<cover.1372010917.git.trast@inf.ethz.ch>

1b3185f (MALLOC_CHECK: various clean-ups, 2012-09-14) moved around the MALLOC_CHECK_ and MALLOC_PERTURB_ assignments, intending to limit their effect to only the test runs. However, they were actually enabled only during test cleanup. Call setup/teardown_malloc_check also around the evaluation of the actual test snippet.

Signed-off-by: Thomas Rast <trast@inf.ethz.ch>
---
 t/test-lib.sh | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index eff3a65..35da859 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -337,8 +337,10 @@ test_eval_ () {
 test_run_ () {
 	test_cleanup=:
 	expecting_failure=$2
+	setup_malloc_check
 	test_eval_ "$1"
 	eval_ret=$?
+	teardown_malloc_check
 
 	if test -z "$immediate" || test $eval_ret = 0 || test -n "$expecting_failure"
 	then
-- 
1.8.3.1.727.gcbe3af3
Previous: Thomas RastNext: Thomas Rast
Message 2 of 9 in “--valgrind improvements”
  1. 0/8 --valgrind improvementsThomas Rast, Jun 23, 2013
  2. 1/8 test-lib: enable MALLOC_* for the actual testsThomas Rast, Jun 23, 2013
  3. 2/8 test-lib: refactor $GIT_SKIP_TESTS matchingThomas Rast, Jun 23, 2013
  4. 3/8 test-lib: rearrange start/end of test_expect_* and test_skipThomas Rast, Jun 23, 2013
  5. 4/8 test-lib: self-test that --verbose worksThomas Rast, Jun 23, 2013
  6. 5/8 test-lib: verbose mode for only tests matching a patternThomas Rast, Jun 23, 2013
  7. 6/8 test-lib: valgrind for only tests matching a patternThomas Rast, Jun 23, 2013
  8. 7/8 test-lib: allow prefixing a custom string before "ok N" etc.Thomas Rast, Jun 23, 2013
  9. 8/8 test-lib: support running tests under valgrind in parallelThomas Rast, Jun 23, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.