Improve parallel test suite runner (#9160)

Summary:
* Parallel `make check` would pass if a test binary failed to list gtest
tests. This is now likely to report as a failure.
* Crazy perl was generating some extra incorrect test names causing
extra files and binary invocations. Fixed with cleaner awk.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9160

Test Plan:
For first part, add an 'assert(false);' to start of hash_test main and
see 'make check' pass before, and fail after.

For second part, inspect t/ directory before vs. after. Number of
executed tests is same:

    $ cat log* | grep 'PASSED.*test' | awk '{ tot += $4; } END { print tot; }'
    10469

Reviewed By: ajkr

Differential Revision: D32372006

Pulled By: pdillinger

fbshipit-source-id: 185b3db2b67e3f9198eb75322e4d0493e4fc1beb
This commit is contained in:
Peter Dillinger 2021-11-16 09:57:54 -08:00 committed by Facebook GitHub Bot
parent cff7819dff
commit 230f18b6e1
1 changed files with 2 additions and 5 deletions

View File

@ -825,11 +825,8 @@ parallel_tests = $(patsubst %,parallel_%,$(PARALLEL_TEST))
$(parallel_tests): $(PARALLEL_TEST)
$(AM_V_at)TEST_BINARY=$(patsubst parallel_%,%,$@); \
TEST_NAMES=` \
./$$TEST_BINARY --gtest_list_tests \
| perl -n \
-e 's/ *\#.*//;' \
-e '/^(\s*)(\S+)/; !$$1 and do {$$p=$$2; break};' \
-e 'print qq! $$p$$2!'`; \
(./$$TEST_BINARY --gtest_list_tests || echo " $${TEST_BINARY}__list_tests_failure") \
| awk '/^[^ ]/ { prefix = $$1 } /^[ ]/ { print prefix $$1 }'`; \
for TEST_NAME in $$TEST_NAMES; do \
TEST_SCRIPT=t/run-$$TEST_BINARY-$${TEST_NAME//\//-}; \
echo " GEN " $$TEST_SCRIPT; \