From a5b7cb6e6f5aa83f16643f7499b1a4bb20269871 Mon Sep 17 00:00:00 2001 From: Arne Becker <101113822+EbiArnie@users.noreply.github.com> Date: Sat, 2 Mar 2024 18:37:35 +0000 Subject: [PATCH] perl-test-xml-simple and deps: new packages (#42873) * perl-test-longstring: New package Adds Test::LongString * perl-test-xml-simple: new package - Adds perl-test-xml-simple --- .../packages/perl-test-longstring/package.py | 27 +++++++++++++++ .../packages/perl-test-xml-simple/package.py | 34 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 var/spack/repos/builtin/packages/perl-test-longstring/package.py create mode 100644 var/spack/repos/builtin/packages/perl-test-xml-simple/package.py diff --git a/var/spack/repos/builtin/packages/perl-test-longstring/package.py b/var/spack/repos/builtin/packages/perl-test-longstring/package.py new file mode 100644 index 0000000000..e611ffce41 --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-test-longstring/package.py @@ -0,0 +1,27 @@ +# 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 PerlTestLongstring(PerlPackage): + """Tests strings for equality, with more helpful failures""" + + homepage = "https://metacpan.org/pod/Test::LongString" + url = "https://cpan.metacpan.org/authors/id/R/RG/RGARCIA/Test-LongString-0.17.tar.gz" + + maintainers("EbiArnie") + + license("Artistic-1.0-Perl OR GPL-1.0-or-later") + + version("0.17", sha256="abc4349eaf04d1bec1e464166a3018591ea846d8f3c5c9c8af4ac4905d3e974f") + + def test_use(self): + """Test 'use module'""" + options = ["-we", 'use strict; use Test::LongString; print("OK\n")'] + + perl = self.spec["perl"].command + out = perl(*options, output=str.split, error=str.split) + assert "OK" in out diff --git a/var/spack/repos/builtin/packages/perl-test-xml-simple/package.py b/var/spack/repos/builtin/packages/perl-test-xml-simple/package.py new file mode 100644 index 0000000000..8ed95c6824 --- /dev/null +++ b/var/spack/repos/builtin/packages/perl-test-xml-simple/package.py @@ -0,0 +1,34 @@ +# 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 PerlTestXmlSimple(PerlPackage): + """Easy testing for XML""" + + homepage = "https://metacpan.org/pod/Test::XML::Simple" + url = "https://cpan.metacpan.org/authors/id/M/MC/MCMAHON/Test-XML-Simple-1.05.tar.gz" + + maintainers("EbiArnie") + + license("Artistic-1.0") + + version("1.05", sha256="c60801a3459e7bdad4cd8007a3c94aede818a829d74e70261e6c2758b227bd53") + + depends_on("perl-test-longstring", type=("build", "run", "test")) + depends_on("perl-xml-libxml@1.99:", type=("build", "run", "test")) + + # The test suite from upstream is failing, so we just skip the tests + def check(self): + pass + + def test_use(self): + """Test 'use module'""" + options = ["-we", 'use strict; use Test::XML::Simple; print("OK\n")'] + + perl = self.spec["perl"].command + out = perl(*options, output=str.split, error=str.split) + assert "OK" in out