archer: convert to new stand-alone test process (#35697)
This commit is contained in:
parent
3b9454a5cc
commit
ab3ffd9361
@ -3,7 +3,6 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
@ -50,25 +49,17 @@ def cache_test_sources(self):
|
|||||||
install test subdirectory for use during `spack test run`."""
|
install test subdirectory for use during `spack test run`."""
|
||||||
self.cache_extra_test_sources(["test"])
|
self.cache_extra_test_sources(["test"])
|
||||||
|
|
||||||
def run_parallel_example_test(self):
|
def test_run_parallel_example(self):
|
||||||
"""Run stand alone test: parallel-simple"""
|
"""build and run parallel-simple"""
|
||||||
|
|
||||||
test_dir = join_path(self.test_suite.current_test_cache_dir, "test", "parallel")
|
test_dir = join_path(self.test_suite.current_test_cache_dir, "test", "parallel")
|
||||||
|
|
||||||
if not os.path.exists(test_dir):
|
if not os.path.exists(test_dir):
|
||||||
print("Skipping archer test")
|
raise SkipTest("Parallel test directory does not exist")
|
||||||
return
|
|
||||||
|
|
||||||
exe = "parallel-simple"
|
test_exe = "parallel-simple"
|
||||||
|
test_src = "{0}.c".format(test_exe)
|
||||||
|
with working_dir(test_dir):
|
||||||
|
clang = which("clang-archer")
|
||||||
|
clang("-o", test_exe, test_src)
|
||||||
|
|
||||||
self.run_test(
|
parallel_simple = which(test_exe)
|
||||||
"clang-archer",
|
parallel_simple()
|
||||||
options=["-o", exe, "{0}".format(join_path(test_dir, "parallel-simple.c"))],
|
|
||||||
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_parallel_example_test()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user