test-lib: parse command line options earlier
commit8cf5800681a6f7c3324f835673974e39e598d1b5
authorSZEDER Gábor <szeder.dev@gmail.com>
Sat, 5 Jan 2019 01:08:55 +0000 (5 02:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Jan 2019 17:24:05 +0000 (7 09:24 -0800)
tree44a83215e43e80bfa1f7fb43f80bb60bf856279a
parenta9b2db379b3be3dcb7540e04f10a1d67c3bc974f
test-lib: parse command line options earlier

'test-lib.sh' looks for the presence of certain options like '--tee'
and '--verbose-log', so it can execute the test script again to save
its standard output and error.  It looks for '--valgrind' as well, to
set up some Valgrind-specific stuff.  These all happen before the
actual option parsing loop, and the conditions looking for these
options look a bit odd, too.  They are not completely correct, either,
because in a bogus invocation like './t1234-foo.sh -r --tee' they
recognize '--tee', although it should be handled as the required
argument of the '-r' option.  This patch series will add two more
options to look out for early, and, in addition, will have to extract
these options' stuck arguments (i.e. '--opt=arg') as well.

So let's move the option parsing loop and the couple of related
conditions following it earlier in 'test-lib.sh', before the place
where the test script is executed again for '--tee' and its friends.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh