path: root/t/
AgeCommit message (Collapse)Author
2013-10-29t: use perl instead of "$PERL_PATH" where applicableJeff King
As of the last commit, we can use "perl" instead of "$PERL_PATH" when running tests, as the former is now a function which uses the latter. As the shorter "perl" is easier on the eyes, let's switch to using it everywhere. This is not quite a mechanical s/$PERL_PATH/perl/ replacement, though. There are some places where we invoke perl from a script we generate on the fly, and those scripts do not have access to our internal shell functions. The result can be double-checked by running: ln -s /bin/false bin-wrappers/perl make test which continues to pass even after this patch. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2011-10-21Add simple test for Git::config_path() in t/t9700-perl-git.shJakub Narebski
Tests "~/foo" path expansion and multiple values. Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-06-25tests: Skip tests in a way that makes sense under TAPÆvar Arnfjörð Bjarmason
SKIP messages are now part of the TAP plan. A TAP harness now knows why a particular test was skipped and can report that information. The non-TAP harness built into Git's test-lib did nothing special with these messages, and is unaffected by these changes. Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
2010-06-25test-lib: Make the test_external_* functions TAP-awareÆvar Arnfjörð Bjarmason
Before TAP we just ran the Perl test and assumed that it failed if nothing was printed on STDERR. Continue doing that, but introduce a `test_external_has_tap' variable which tests can set to indicate that they're outputting TAP. If it's set we won't output a test plan, but trust the external test to do so. That way we can make external tests work with a TAP harness, but still maintain compatibility with test-lib's own way of tracking tests through the test-results directory. Signed-off-by: Ævar Arnfjörð Bjarmason <> Signed-off-by: Junio C Hamano <>
2009-11-17Make sure $PERL_PATH is defined when the test suite is run.Philippe Bruhat (BooK)
Some test scripts run Perl scripts as if they were git-* scripts, and thus need to use the same perl that will be put in the shebang line of git*.perl commands. $PERL_PATH therefore needs to be used instead of a bare "perl". The tests can fail if another perl is found in $PATH before the one defined in $PERL_PATH. Example test failure caused by this: the perl defined in $PERL_PATH has installed, and therefore the's Makefile.PL doesn't install the private copy. The perl from $PATH doesn't have installed, and all git*.perl scripts invoked during the test will fail loading Makefile patch by Jeff King <>. Signed-off-by: Philippe Bruhat (BooK) <> Signed-off-by: Junio C Hamano <> Set GIT_WORK_TREE if we set GIT_DIRFrank Lichtenheld
Otherwise git will use the current directory as work tree which will lead to unexpected results if we operate in sub directory of the work tree. Signed-off-by: Frank Lichtenheld <> Acked-by: Petr Baudis <> Signed-off-by: Junio C Hamano <>
2009-04-09tests: skip perl tests if NO_PERL is definedJeff King
These scripts all test git programs that are written in perl, and thus obviously won't work if NO_PERL is defined. We pass NO_PERL to the scripts from the building Makefile via the GIT-BUILD-OPTIONS file. Signed-off-by: Jeff King <> Signed-off-by: Junio C Hamano <>
2009-03-19test suite: Use 'say' to say something instead of 'test_expect_success'Johannes Sixt
Some tests report that some tests will be skipped. They used 'test_expect_success' with a trivially successful test. Nowadays we have the helper function 'say' for this purpose. In on case, 'say_color skip' is replaced by 'say' because the former is not intended as a public API. Signed-off-by: Johannes Sixt <>
2008-09-10t9700: use "git config" without dashNanako Shiraishi
Signed-off-by: Nanako Shiraishi <> Signed-off-by: Junio C Hamano <>
2008-08-17tests: use $TEST_DIRECTORY to refer to the t/ directoryJunio C Hamano
Many test scripts assumed that they will start in a 'trash' subdirectory that is a single level down from the t/ directory, and referred to their test vector files by asking for files like "../t9999/expect". This will break if we move the 'trash' subdirectory elsewhere. To solve this, we earlier introduced "$TEST_DIRECTORY" so that they can refer to t/ directory reliably. This finally makes all the tests use it to refer to the outside environment. With this patch, and a one-liner not included here (because it would contradict with what Dscho really wants to do): | diff --git a/t/ b/t/ | index 70ea7e0..60e69e4 100644 | --- a/t/ | +++ b/t/ | @@ -485,7 +485,7 @@ fi | . ../GIT-BUILD-OPTIONS | | # Test repository | -test="trash directory" | +test="trash directory/another level/yet another" | rm -fr "$test" || { | trap - exit | echo >&5 "FATAL: Cannot prepare test area" all the tests still pass, but we would want extra sets of eyeballs on this type of change to really make sure. [jc: with help from Stephan Beyer on http-push tests I do not run myself; credits for locating silly quoting errors go to Olivier Marin.] Signed-off-by: Junio C Hamano <>
2008-06-30t9700: skip when Test::More is not availableJunio C Hamano
Signed-off-by: Junio C Hamano <> add test suiteLea Wiemann
Add a shell script (t/ that sets up a git repository and a perl script (t/t9700/ that runs the actual tests. Signed-off-by: Lea Wiemann <> Signed-off-by: Junio C Hamano <>