gitweb tests: skip tests when we don't have Time::HiRes
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 1 Mar 2017 21:15:40 +0000 (21:15 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Mar 2017 22:39:50 +0000 (14:39 -0800)
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/gitweb-lib.sh
index 59ef15efbdb80782248cb93b04efdfd7c82bf22a..006d2a8152dc499f3588b130470285703b60dc92 100644 (file)
@@ -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