summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>2023-05-29 01:16:35 -0700
committerGitHub <noreply@github.com>2023-05-29 10:16:35 +0200
commit3a5864bcdb4174c8fa3c8647bfde17594ad0f925 (patch)
treea47b1edf96fee37b2c459ae40f324cfd0241c5d4 /lib
parent7e13a7dccbbe9c469daad11e1e9746e871acd289 (diff)
downloadspack-3a5864bcdb4174c8fa3c8647bfde17594ad0f925.tar.gz
spack-3a5864bcdb4174c8fa3c8647bfde17594ad0f925.tar.bz2
spack-3a5864bcdb4174c8fa3c8647bfde17594ad0f925.tar.xz
spack-3a5864bcdb4174c8fa3c8647bfde17594ad0f925.zip
tests/sip: convert to new stand-alone test process (#35693)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/build_systems/sip.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/build_systems/sip.py b/lib/spack/spack/build_systems/sip.py
index c45254ebb0..3ec43f5f82 100644
--- a/lib/spack/spack/build_systems/sip.py
+++ b/lib/spack/spack/build_systems/sip.py
@@ -10,6 +10,7 @@ import llnl.util.tty as tty
from llnl.util.filesystem import find, join_path, working_dir
import spack.builder
+import spack.install_test
import spack.package_base
from spack.directives import build_system, depends_on, extends
from spack.multimethod import when
@@ -30,8 +31,8 @@ class SIPPackage(spack.package_base.PackageBase):
#: Name of private sip module to install alongside package
sip_module = "sip"
- #: Callback names for install-time test
- install_time_test_callbacks = ["test"]
+ #: Callback names for install-time testing
+ install_time_test_callbacks = ["test_imports"]
#: Legacy buildsystem attribute used to deserialize and install old specs
legacy_buildsystem = "sip"
@@ -87,18 +88,20 @@ class SIPPackage(spack.package_base.PackageBase):
"""The python ``Executable``."""
inspect.getmodule(self).python(*args, **kwargs)
- def test(self):
+ def test_imports(self):
"""Attempts to import modules of the installed package."""
# Make sure we are importing the installed modules,
# not the ones in the source directory
+ python = inspect.getmodule(self).python
for module in self.import_modules:
- self.run_test(
- inspect.getmodule(self).python.path,
- ["-c", "import {0}".format(module)],
+ with spack.install_test.test_part(
+ self,
+ "test_imports_{0}".format(module),
purpose="checking import of {0}".format(module),
work_dir="spack-test",
- )
+ ):
+ python("-c", "import {0}".format(module))
@spack.builder.builder("sip")