From: Thomas Gummerer Date: Mon, 23 Sep 2013 21:08:44 GMT Subject: [PATCH v2 1/3] test-lib: introduce "modern" style tests Message-ID: <1379970526-27997-2-git-send-email-t.gummerer@gmail.com> In-Reply-To: <1379970526-27997-1-git-send-email-t.gummerer@gmail.com> From: Junio C Hamano Add a new, extensible style for tests that allows the addition of new parameters other than the prerequitites Signed-off-by: Junio C Hamano Signed-off-by: Thomas Gummerer --- t/README | 24 +++++++++++++++-- t/perf/README | 12 ++++++++- t/perf/perf-lib.sh | 17 +++++------- t/t0008-ignores.sh | 34 +++++++++++------------ t/test-lib-functions.sh | 72 ++++++++++++++++++++++++++++++++++++++----------- 5 files changed, 114 insertions(+), 45 deletions(-) diff --git a/t/README b/t/README index 2167125..bf41c29 100644 --- a/t/README +++ b/t/README @@ -390,6 +390,12 @@ below), e.g.: "$PERL_PATH" -e "hlagh() if unf_unf()" ' +or in the "modern" form, specifying the prerequisite as a parameter, e.g.: + + test_expect_success --prereq PERL 'I need Perl' ' + "$PERL_PATH" -e "hlagh() if unf_unf()" + ' + The advantage of skipping tests like this is that platforms that don't have the PERL and other optional dependencies get an indication of how many tests they're missing. @@ -422,6 +428,7 @@ There are a handful helper functions defined in the test harness library for your script to use. - test_expect_success []