]> The Tcpdump Group git mirrors - libpcap/commit
TESTrun: Implement parallel testing.
authorDenis Ovsienko <[email protected]>
Fri, 17 Jan 2025 18:45:13 +0000 (18:45 +0000)
committerDenis Ovsienko <[email protected]>
Sat, 18 Jan 2025 20:03:32 +0000 (20:03 +0000)
commit3e30d5106bd34bdefc3e0e6382690bc46f5e3ba9
tree726bc8a9a3b7b015aca79fbda62080f386f01ded
parentcf33e7e2aace3c1ceb5e921ebe9a4fe282db19c0
TESTrun: Implement parallel testing.

The filter tests have made the build matrix slower (especially with
Valgrind), and several CI environments have more than one CPU core
available, so implement an option to run more than one tester thread
(thus more than one timeout/Valgrind/filtertest/diff process) at a time.

Add a new TESTRUN_JOBS environment variable.  Spell the difference
between test blocks and tests.  Rename the temporary directory for
clarity and include a prefix returned by a function into all temporary
file names.

Refactor the existing two main loops, which do pretty much everything in
a single thread.  Instead use two single-threaded loops to validate two
heterogenous input data structures and to produce a homogenous sequence
of ready-to-run tests, and another single-threaded loop to collect and
to report the results.  Have a test-to-result conversion subroutine for
each of the test types (skip/accept/reject) and store a reference to the
required subroutine in each ready-to-run test.

This way only the temporary prefix, the number of jobs setup, starting
of the tests and production of the next result remain specific to
whether Perl has threads support (most platforms) or not (OpenBSD).
Arrange a Perl module for each of these two cases and require one that
is appropriate for the Perl build.

Make use of uninitialized variables a fatal error.  Add a sanity check
for the totals at the end.  When running multi-threaded, add output
buffering fixups to make the progress responsive enough for the usage
(interactive or not).  Update various comments.  Use the new feature in
the macos-aarch64 Cirrus CI task.
.cirrus.yml
testprogs/TESTmt.pm [new file with mode: 0644]
testprogs/TESTrun
testprogs/TESTst.pm [new file with mode: 0644]