summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/perl-test2-plugin-nowarnings/package.py
blob: 61639daa323529a4ade31b865fa001a9c840c49b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
# Copyright 2023 EMBL-European Bioinformatics Institute
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *


class PerlTest2PluginNowarnings(PerlPackage):
    """Fail if tests warn"""

    homepage = "https://metacpan.org/pod/Test2::Plugin::NoWarnings"
    url = "https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Test2-Plugin-NoWarnings-0.09.tar.gz"

    maintainers("EbiArnie")

    license("Artistic-2.0")

    version("0.09", sha256="be3dd800042eef362bf17d2056cf9e934dee91ccce98e4f178b8fb5772f2fb74")

    depends_on("perl-ipc-run3", type=("build", "test"))
    depends_on("perl-test2-suite", type=("build", "test"))

    def test_use(self):
        """Test 'use module'"""
        options = ["-we", 'use strict; use Test2::Plugin::NoWarnings; print("OK\n")']

        perl = self.spec["perl"].command
        out = perl(*options, output=str.split, error=str.split)
        assert "OK" in out