threads / patch / 45257

v2, 2 partsgitweb tests: Skip tests when we don't have Time::HiRes

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

## tl;dr

4 messages between Mar 1, 2017 and Mar 1, 2017. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Ævar Arnfjörð Bjarmason· Mar 1, 2017, 21:15 UTC · lore

[PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes

This was originally just one small patch, but Jakub Narębski pointed out that calling the module "unusable" when we failed to load it was confusing, so now the start of this series is just a rephrasing of an existing error message I copied.

Ævar Arnfjörð Bjarmason (2):
  gitweb tests: Change confusing "skip_all" phrasing
  gitweb tests: Skip tests when we don't have Time::HiRes
 t/gitweb-lib.sh | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
-- 
2.11.0
Ævar Arnfjörð Bjarmason· Mar 1, 2017, 21:15 UTC · re: Ævar Arnfjörð Bjarmason · lore

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(+)
Show changes to t/gitweb-lib.sh +5 −0
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
Ævar Arnfjörð Bjarmason· Mar 1, 2017, 21:15 UTC · re: Ævar Arnfjörð Bjarmason · lore

[PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing

Change the phrasing so that instead of saying that the CGI module is unusable, we say that it's not available.

This came up on the git mailing list in <4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com> from Jakub Narębski.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/gitweb-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Show changes to t/gitweb-lib.sh +1 −1
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index d5dab5a94f..59ef15efbd 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -110,7 +110,7 @@ perl -MEncode -e '$e="";decode_utf8($e, Encode::FB_CROAK)' >/dev/null 2>&1 || {
 }
 
 perl -MCGI -MCGI::Util -MCGI::Carp -e 0 >/dev/null 2>&1 || {
-	skip_all='skipping gitweb tests, CGI module unusable'
+	skip_all='skipping gitweb tests, CGI & CGI::Util & CGI::Carp modules not available'
 	test_done
 }
 
-- 
2.11.0

← back to recent threads