git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes
@ 2017-02-27 12:37 Ævar Arnfjörð Bjarmason
  2017-02-27 17:48 ` Jakub Narębski
  0 siblings, 1 reply; 7+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2017-02-27 12:37 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

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

This module has bee 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 d5dab5a94f..116c3890e6 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 unusable'
+	test_done
+}
+
 gitweb_init
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-01 23:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-27 12:37 [PATCH] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason
2017-02-27 17:48 ` Jakub Narębski
2017-02-27 18:25   ` Ævar Arnfjörð Bjarmason
2017-03-01 21:15   ` [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes Ævar Arnfjörð Bjarmason
2017-03-01 22:42     ` Junio C Hamano
2017-03-01 21:15   ` [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing Ævar Arnfjörð Bjarmason
2017-03-01 21:15   ` [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes Ævar Arnfjörð Bjarmason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).