mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
t: introduce compatibility options to clar-based tests
Our unit tests that don't yet use the clar unit testing framework ignore any option that they do not understand. It is thus fine to just pass test options we set up globally to those unit tests as they are simply ignored. This makes our life easier because we don't have to special case those options with Meson, where test options are set up globally via `meson test --test-args=`. But our clar-based unit testing framework is way stricter here and will fail in case it is passed an unknown option. Stub out these options with no-ops to make our life a bit easier. Note that this also requires us to remove the `-x` short option for `--exclude`. This is because `-x` has another meaning in our integration tests, as it enables shell tracing. I doubt there are a lot of people out there using it as we only got a small hand full of clar tests in the first place. So better change it now so that we can in the long run improve compatibility between the two different test drivers. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
78ad7291df
commit
9faf3963b6
@@ -353,6 +353,18 @@ struct option {
|
||||
.callback = parse_opt_noop_cb, \
|
||||
}
|
||||
|
||||
static char *parse_options_noop_ignored_value MAYBE_UNUSED;
|
||||
#define OPT_NOOP_ARG(s, l) { \
|
||||
.type = OPTION_CALLBACK, \
|
||||
.short_name = (s), \
|
||||
.long_name = (l), \
|
||||
.value = &parse_options_noop_ignored_value, \
|
||||
.argh = "ignored", \
|
||||
.help = N_("no-op (backward compatibility)"), \
|
||||
.flags = PARSE_OPT_HIDDEN, \
|
||||
.callback = parse_opt_noop_cb, \
|
||||
}
|
||||
|
||||
#define OPT_ALIAS(s, l, source_long_name) { \
|
||||
.type = OPTION_ALIAS, \
|
||||
.short_name = (s), \
|
||||
|
||||
Reference in New Issue
Block a user