git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t9700: Use Test::More->builder, not $Test::Builder::Test

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jun 26, 2010, 12:21 UTC
Message-ID
<1277554872-6402-1-git-send-email-avarab@gmail.com>
In-Reply-To
<1277401489-27885-1-git-send-email-avarab@gmail.com>

$Test::Builder::Test was only made into an `our' variable in 0.94 released in September 2009, older distros are more likely to have 0.92 or earlier. Use the singleton Test::More->builder constructor instead, the test now works on 0.92 too.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---

This patch fixes the TAP output in pu for older Test::More libraries. It could be applied as a fixup to "test-lib: Make the test_external_* functions TAP-aware", but it's probably useful to note this in the version history.

 t/t9700/test.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t9700/test.pl b/t/t9700/test.pl
index e5d4b03..3e6a27c 100755
--- a/t/t9700/test.pl
+++ b/t/t9700/test.pl
@@ -10,8 +10,8 @@ use Test::More qw(no_plan);
 BEGIN {
 	# t9700-perl-git.sh kicks off our testing, so we have to go from
 	# there.
-	$Test::Builder::Test->{Curr_Test} = 1;
-	$Test::Builder::Test->{No_Ending} = 1;
+	Test::More->builder->{Curr_Test} = 1;
+	Test::More->builder->{No_Ending} = 1;
 }
 
 use Cwd;
@@ -113,6 +113,6 @@ like($last_commit, qr/^[0-9a-fA-F]{40}$/, 'rev-parse returned hash');
 my $dir_commit = $r2->command_oneline('log', '-n1', '--pretty=format:%H', '.');
 isnt($last_commit, $dir_commit, 'log . does not show last commit');
 
-printf "1..%d\n", $Test::Builder::Test->{Curr_Test};
+printf "1..%d\n", Test::More->builder->{Curr_Test};
 
-exit($Test::Builder::Test->{Is_Passing} ? 0 : 1);
+exit(Test::More->builder->{Is_Passing} ? 0 : 1);
-- 
1.7.1.251.g92a7
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 14 of 16 in “TAP support for Git”
  1. 0/5 TAP support for GitÆvar Arnfjörð Bjarmason, Jun 24, 2010
  2. 1/5 test-lib: Adjust output to be valid TAP formatÆvar Arnfjörð Bjarmason, Jun 24, 2010
  3. Jakub NarebskiJun 24, 2010
  4. Ævar Arnfjörð BjarmasonJun 24, 2010
  5. 1/5 test-lib: Adjust output to be valid TAP formatÆvar Arnfjörð Bjarmason, Jun 24, 2010
  6. Junio C HamanoJun 25, 2010
  7. Ævar Arnfjörð BjarmasonJun 25, 2010
  8. Junio C HamanoJun 25, 2010
  9. Ævar Arnfjörð BjarmasonJun 25, 2010
  10. 2/5 test-lib: Make the test_external_* functions TAP-awareÆvar Arnfjörð Bjarmason, Jun 24, 2010
  11. 3/5 test-lib: output a newline before "ok" under a TAP harnessÆvar Arnfjörð Bjarmason, Jun 24, 2010
  12. 4/5 tests: Skip tests in a way that makes sense under TAPÆvar Arnfjörð Bjarmason, Jun 24, 2010
  13. 5/5 tests: Say "pass" rather than "ok" on empty lines for TAPÆvar Arnfjörð Bjarmason, Jun 24, 2010
  14. t9700: Use Test::More->builder, not $Test::Builder::TestÆvar Arnfjörð Bjarmason, Jun 26, 2010
  15. t9700: Use Test::More->builder, not $Test::Builder::TestÆvar Arnfjörð Bjarmason, Jun 26, 2010
  16. Junio C HamanoJun 27, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.