SCRIPTS: run-regtests: reduce the number of processes needed to check options
authorWilly Tarreau <w@1wt.eu>
Thu, 18 Nov 2021 12:49:01 +0000 (13:49 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 18 Nov 2021 16:54:49 +0000 (17:54 +0100)
commit969e7afa0dd5241d4cf369698d121ffcddf60d3a
treee5de743f9b670dbe32b054d93deaaf9e88abf497
parentec347b1239202dafbccf89a06a39fb5986400e19
SCRIPTS: run-regtests: reduce the number of processes needed to check options

run-tegtests is starting to take a lot of time to spot which tests are
eligible, because for each test file a lot of "sed" sub-processes are
launched. This commit eliminates calls to sed by using the shell's
internal processing and parsing the VTC file only once. Instead of
extracting each option one by one from the file, all entries that look
like a valid option are passed to a single case/esac statement and their
value is extracted. Splitting into lists is simply done by adjusting the
IFS depending on the list's delimiter, which, contrary to the // pattern
modifier, is supported on every shell.

This was tested on both bash and dash, and the tests' execution time
dropped by 31% from 8.7 seconds to 6.0 seconds.
scripts/run-regtests.sh