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

[PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 1, 2017, 21:15 UTC
Message-ID
<20170301211540.4382-3-avarab@gmail.com>
In-Reply-To
<20170301211540.4382-1-avarab@gmail.com>

Change the gitweb tests to skip when we can't load the Time::HiRes module.

Gitweb needs this module to work. It has been in perl core since v5.8, which is the oldest version we support. However CentOS (and perhaps some other distributions) carve it into its own non-core-perl package that's not installed along with /usr/bin/perl by default. Without this we'll hard fail the gitweb tests when trying to load the module.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/gitweb-lib.sh | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 59ef15efbd..b7a73874e7 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -114,4 +114,9 @@ perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
 	test_done
 }
 
+perl -mTime::HiRes -e 0  >/dev/null 2>&1 || {
+	skip_all='skipping gitweb tests, Time::HiRes module not available'
+	test_done
+}
+
 gitweb_init
-- 
2.11.0
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 4 in “Minor changes to skip gitweb tests without Time::HiRes”
  1. 0/2 Minor changes to skip gitweb tests without Time::HiResÆvar Arnfjörð Bjarmason, Mar 1, 2017
  2. 2/2 gitweb tests: Skip tests when we don't have Time::HiResÆvar Arnfjörð Bjarmason, Mar 1, 2017
  3. 1/2 gitweb tests: Change confusing "skip_all" phrasingÆvar Arnfjörð Bjarmason, Mar 1, 2017
  4. Junio C HamanoMar 1, 2017

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.