bolt: fix standalone test (#29389)
This commit is contained in:
parent
64532902f9
commit
8986c21d73
@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
from llnl.util import tty
|
||||||
|
|
||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
@ -57,19 +59,19 @@ def run_sample_nested_example(self):
|
|||||||
"""Run stand alone test: sample_nested"""
|
"""Run stand alone test: sample_nested"""
|
||||||
|
|
||||||
test_dir = join_path(self.test_suite.current_test_cache_dir, 'examples')
|
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):
|
if not os.path.isfile(join_path(test_dir, source_file)):
|
||||||
print('Skipping bolt test')
|
tty.warn('Skipping bolt test:'
|
||||||
|
'{0} does not exist'.format(source_file))
|
||||||
return
|
return
|
||||||
|
|
||||||
exe = 'sample_nested'
|
self.run_test(exe=os.environ['CXX'],
|
||||||
|
options=['-L{0}'.format(self.prefix.lib),
|
||||||
# TODO: Either change to use self.compiler.cc (so using the build-time compiler)
|
'-I{0}'.format(self.prefix.include),
|
||||||
# or add test parts that compile with the different supported compilers.
|
'{0}'.format(join_path(test_dir, source_file)),
|
||||||
self.run_test('gcc',
|
'-o', exe, '-lomp', '-lbolt'],
|
||||||
options=['-lomp', '-o', exe,
|
|
||||||
'-L{0}'.format(join_path(self.prefix, 'lib')),
|
|
||||||
'{0}'.format(join_path(test_dir, 'sample_nested.c'))],
|
|
||||||
purpose='test: compile {0} example'.format(exe),
|
purpose='test: compile {0} example'.format(exe),
|
||||||
work_dir=test_dir)
|
work_dir=test_dir)
|
||||||
|
|
||||||
@ -78,5 +80,4 @@ def run_sample_nested_example(self):
|
|||||||
work_dir=test_dir)
|
work_dir=test_dir)
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
print("Running bolt test")
|
|
||||||
self.run_sample_nested_example()
|
self.run_sample_nested_example()
|
||||||
|
Loading…
Reference in New Issue
Block a user