summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin.mock/packages/py-test-callback/package.py
blob: 46a16a465fca61f765c2330c4292f1404c5e455b (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
# 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)

import spack.pkg.builtin.mock.python as mp
from spack.package import *


class PyTestCallback(mp.Python):
    """A package for testing stand-alone test methods as a callback."""

    homepage = "http://www.example.com"
    url = "http://www.example.com/test-callback-1.0.tar.gz"

    # TODO (post-34236): "test" -> "test_callback" once remove "test" support
    install_time_test_callbacks = ["test"]

    version("1.0", "00000000000000000000000000000110")
    version("2.0", "00000000000000000000000000000120")

    def install(self, spec, prefix):
        mkdirp(prefix.bin)

    # TODO (post-34236): "test" -> "test_callback" once remove "test" support
    def test(self):
        super().test()

        print("PyTestCallback test")