summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/simple-standalone-test/package.py
blob: 1adfb9507a72b21609cb85ec58479416a93f8335 (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
# Copyright 2013-2023 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 SimpleStandaloneTest(Package):
    """This package has simple stand-alone test features."""

    homepage = "http://www.example.com/simple_test"
    url = "http://www.unit-test-should-replace-this-url/simple_test-1.0.tar.gz"

    version("1.0", md5="123456789abcdef0123456789abcdefg")
    version("0.9", md5="0123456789abcdef0123456789abcdef")

    provides("standalone-ifc")

    def test_echo(self):
        """simple stand-alone test"""
        echo = which("echo")
        echo("testing echo", output=str.split, error=str.split)

    def test_skip(self):
        """simple skip test"""
        if self.spec.satisfies("@1.0:"):
            raise SkipTest("This test is not available from v1.0 on")

        print("Ran test_skip")