summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRicharda Butler <39577672+RikkiButler20@users.noreply.github.com>2022-03-08 09:25:13 -0800
committerGitHub <noreply@github.com>2022-03-08 18:25:13 +0100
commit8986c21d7396d866bb2f3c07406b5d51f367ea0f (patch)
tree87b295ec460ef4b1a3970f24c647f66857148f86 /var
parent64532902f966268cdeaa44327dfc44b0564abc2f (diff)
downloadspack-8986c21d7396d866bb2f3c07406b5d51f367ea0f.tar.gz
spack-8986c21d7396d866bb2f3c07406b5d51f367ea0f.tar.bz2
spack-8986c21d7396d866bb2f3c07406b5d51f367ea0f.tar.xz
spack-8986c21d7396d866bb2f3c07406b5d51f367ea0f.zip
bolt: fix standalone test (#29389)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/bolt/package.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/var/spack/repos/builtin/packages/bolt/package.py b/var/spack/repos/builtin/packages/bolt/package.py
index f7d14ffe2a..57b64e45ca 100644
--- a/var/spack/repos/builtin/packages/bolt/package.py
+++ b/var/spack/repos/builtin/packages/bolt/package.py
@@ -5,6 +5,8 @@
import os
+from llnl.util import tty
+
from spack import *
@@ -57,19 +59,19 @@ class Bolt(CMakePackage):
"""Run stand alone test: sample_nested"""
test_dir = join_path(self.test_suite.current_test_cache_dir, 'examples')
+ exe = 'sample_nested'
+ source_file = 'sample_nested.c'
- if not os.path.exists(test_dir):
- print('Skipping bolt test')
+ if not os.path.isfile(join_path(test_dir, source_file)):
+ tty.warn('Skipping bolt test:'
+ '{0} does not exist'.format(source_file))
return
- exe = 'sample_nested'
-
- # TODO: Either change to use self.compiler.cc (so using the build-time compiler)
- # or add test parts that compile with the different supported compilers.
- self.run_test('gcc',
- options=['-lomp', '-o', exe,
- '-L{0}'.format(join_path(self.prefix, 'lib')),
- '{0}'.format(join_path(test_dir, 'sample_nested.c'))],
+ self.run_test(exe=os.environ['CXX'],
+ options=['-L{0}'.format(self.prefix.lib),
+ '-I{0}'.format(self.prefix.include),
+ '{0}'.format(join_path(test_dir, source_file)),
+ '-o', exe, '-lomp', '-lbolt'],
purpose='test: compile {0} example'.format(exe),
work_dir=test_dir)
@@ -78,5 +80,4 @@ class Bolt(CMakePackage):
work_dir=test_dir)
def test(self):
- print("Running bolt test")
self.run_sample_nested_example()