summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/bolt/package.py37
1 files changed, 15 insertions, 22 deletions
diff --git a/var/spack/repos/builtin/packages/bolt/package.py b/var/spack/repos/builtin/packages/bolt/package.py
index acffd87afc..e575ee6cfd 100644
--- a/var/spack/repos/builtin/packages/bolt/package.py
+++ b/var/spack/repos/builtin/packages/bolt/package.py
@@ -5,8 +5,6 @@
import os
-from llnl.util import tty
-
from spack.package import *
@@ -26,6 +24,8 @@ class Bolt(CMakePackage):
git = "https://github.com/pmodels/bolt.git"
maintainers("shintaro-iwasaki")
+ test_requires_compiler = True
+
tags = ["e4s"]
version("main", branch="main")
@@ -33,8 +33,6 @@ class Bolt(CMakePackage):
version("1.0.1", sha256="769e30dfc4042cee7ebbdadd23cf08796c03bcd8b335f516dc8cbc3f8adfa597")
version("1.0", sha256="1c0d2f75597485ca36335d313a73736594e75c8a36123c5a6f54d01b5ba5c384")
- test_requires_compiler = True
-
depends_on("argobots")
depends_on("autoconf", type="build")
depends_on("automake", type="build")
@@ -55,20 +53,20 @@ class Bolt(CMakePackage):
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources(["examples"])
- def run_sample_nested_example(self):
- """Run stand alone test: sample_nested"""
+ def test_sample_nested_example(self):
+ """build and run sample_nested"""
- test_dir = join_path(self.test_suite.current_test_cache_dir, "examples")
exe = "sample_nested"
- source_file = "sample_nested.c"
+ source_file = "{0}.c".format(exe)
- if not os.path.isfile(join_path(test_dir, source_file)):
- tty.warn("Skipping bolt test:" "{0} does not exist".format(source_file))
- return
+ path = find_required_file(
+ self.test_suite.current_test_cache_dir, source_file, expected=1, recursive=True
+ )
- self.run_test(
- exe=os.environ["CXX"],
- options=[
+ test_dir = os.path.dirname(path)
+ with working_dir(test_dir):
+ cxx = which(os.environ["CXX"])
+ cxx(
"-L{0}".format(self.prefix.lib),
"-I{0}".format(self.prefix.include),
"{0}".format(join_path(test_dir, source_file)),
@@ -76,12 +74,7 @@ class Bolt(CMakePackage):
exe,
"-lomp",
"-lbolt",
- ],
- purpose="test: compile {0} example".format(exe),
- work_dir=test_dir,
- )
-
- self.run_test(exe, purpose="test: run {0} example".format(exe), work_dir=test_dir)
+ )
- def test(self):
- self.run_sample_nested_example()
+ sample_nested = which(exe)
+ sample_nested()