perl-test-time-hires: new package (#42957)

Adds Test::Time::HiRes
This commit is contained in:
Arne Becker 2024-03-03 02:10:08 +00:00 committed by GitHub
parent 9ca6aaeafd
commit a8a9e0160a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,31 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PerlTestTimeHires(PerlPackage):
"""Drop-in replacement for Test::Time to work with Time::HiRes"""
homepage = "https://metacpan.org/pod/Test::Time::HiRes"
url = "https://cpan.metacpan.org/authors/id/M/MJ/MJEMMESON/Test-Time-HiRes-0.05.tar.gz"
maintainers("EbiArnie")
license("Artistic-1.0-Perl OR GPL-1.0-or-later")
version("0.05", sha256="c9d692fdb7aed618c54a9d38f27edea148874421281b571b9686d2c5a5a8ff63")
depends_on("perl@5.8.0:", type=("build", "link", "run", "test"))
depends_on("perl-module-build-tiny@0.034:", type=("build"))
depends_on("perl-test-time@0.07:", type=("build", "run", "test"))
def test_use(self):
"""Test 'use module'"""
options = ["-we", 'use strict; use Test::Time::HiRes; print("OK\n")']
perl = self.spec["perl"].command
out = perl(*options, output=str.split, error=str.split)
assert "OK" in out