Subject: [PATCH 0/6] --valgrind improvements

From: Thomas Rast <[email-masked]>
Date: Thu, 16 May 2013 22:50:11 +0200

Peff and me discussed improving the usability of --valgrind testing.
In particular, two ideas that came up were options for running only a
subset of the tests in a file under --valgrind, and for running a
single test script under valgrind while exploiting parallelism.

So here's a little series.  It goes like this:

  test-lib: enable MALLOC_* for the actual tests

Fix for an unrelated bug that I came across.

  test-lib: refactor $GIT_SKIP_TESTS matching
  test-lib: verbose mode for only tests matching a pattern
  test-lib: valgrind for only tests matching a pattern

An option --valgrind-only=<patterns> that lets you run only the
subtest matching <patterns> under valgrind.

  test-lib: allow prefixing a custom string before "ok N" etc.
  test-lib: support running tests under valgrind in parallel

An option --valgrind-parallel=<n> to run <n> instances in parallel,
each of which runs every <n>-th test under valgrind, staggered so that
they cover everything.  It's a bit of a hack, and thus RFC, but gives
decent results.  On my 2-core laptop I measured a just over 2x
speedup.  On a 6-core it starts falling off because of the extra
(non-valgrind) runs, resulting in a 4.8x speedup.

One open issue with the last patch that currently eludes me: if I
combine --valgrind-parallel with any --valgrind=*, there are lots of
errors as (apparently) the valgrind wrapper setups race against each
other.  However, without any --valgrind=* (thus defaulting to
'memcheck') this doesn't happen.

Thomas Rast (6):
  test-lib: enable MALLOC_* for the actual tests
  test-lib: refactor $GIT_SKIP_TESTS matching
  test-lib: verbose mode for only tests matching a pattern
  test-lib: valgrind for only tests matching a pattern
  test-lib: allow prefixing a custom string before "ok N" etc.
  test-lib: support running tests under valgrind in parallel

 t/README               |  10 +++
 t/test-lib.sh          | 175 ++++++++++++++++++++++++++++++++++++++++---------
 t/valgrind/valgrind.sh |   3 +
 3 files changed, 156 insertions(+), 32 deletions(-)

-- 
1.8.3.rc2.393.g8636c0b