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

4 messages from 2017-03-01 to 2017-03-01. Participants: Ævar Arnfjörð Bjarmason, Junio C Hamano.
Thread: https://gitlist.dev/t/45257

## Ævar Arnfjörð Bjarmason, 2017-03-01 21:15

Subject: [PATCH v2 2/2] gitweb tests: Skip tests when we don't have Time::HiRes
Message-ID: <20170301211540.4382-3-avarab@gmail.com>
URL: https://gitlist.dev/e/20170301211540.4382-3-avarab%40gmail.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


```

## Ævar Arnfjörð Bjarmason, 2017-03-01 21:15

Subject: [PATCH v2 1/2] gitweb tests: Change confusing "skip_all" phrasing
Message-ID: <20170301211540.4382-2-avarab@gmail.com>
URL: https://gitlist.dev/e/20170301211540.4382-2-avarab%40gmail.com
In-Reply-To: <20170301211540.4382-1-avarab@gmail.com>

```
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(-)

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


```

## Junio C Hamano, 2017-03-01 22:42

Subject: Re: [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes
Message-ID: <xmqqy3woei11.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqy3woei11.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <20170301211540.4382-1-avarab@gmail.com>

```
Thanks, will replace what has been on 'pu'.

Note that I'd dropped a double-SP from the latter one while queuing.

```

## Ævar Arnfjörð Bjarmason, 2017-03-01 21:15

Subject: [PATCH v2 0/2] Minor changes to skip gitweb tests without Time::HiRes
Message-ID: <20170301211540.4382-1-avarab@gmail.com>
URL: https://gitlist.dev/e/20170301211540.4382-1-avarab%40gmail.com
In-Reply-To: <4b34e3a0-3da7-d821-2a7f-9a420ac1d3f6@gmail.com>

```
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


```
