Legion: Reformatted Old To New Test Method and skipping tests (#44733)
* Legion: reformatted old test method to match new test method * Updated docstring and how cmake file is opened
This commit is contained in:
parent
a389eb5a08
commit
37e2d46d7d
@ -476,18 +476,15 @@ 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([join_path("examples", "local_function_tasks")])
|
self.cache_extra_test_sources([join_path("examples", "local_function_tasks")])
|
||||||
|
|
||||||
def run_local_function_tasks_test(self):
|
def test_run_local_function_tasks(self):
|
||||||
"""Run stand alone test: local_function_tasks"""
|
"""Build and run external application example"""
|
||||||
|
|
||||||
test_dir = join_path(
|
test_dir = join_path(
|
||||||
self.test_suite.current_test_cache_dir, "examples", "local_function_tasks"
|
self.test_suite.current_test_cache_dir, "examples", "local_function_tasks"
|
||||||
)
|
)
|
||||||
|
|
||||||
if not os.path.exists(test_dir):
|
if not os.path.exists(test_dir):
|
||||||
print("Skipping local_function_tasks test")
|
raise SkipTest(f"{test_dir} must exist")
|
||||||
return
|
|
||||||
|
|
||||||
exe = "local_function_tasks"
|
|
||||||
|
|
||||||
cmake_args = [
|
cmake_args = [
|
||||||
f"-DCMAKE_C_COMPILER={self.compiler.cc}",
|
f"-DCMAKE_C_COMPILER={self.compiler.cc}",
|
||||||
@ -495,16 +492,12 @@ def run_local_function_tasks_test(self):
|
|||||||
f"-DLegion_DIR={join_path(self.prefix, 'share', 'Legion', 'cmake')}",
|
f"-DLegion_DIR={join_path(self.prefix, 'share', 'Legion', 'cmake')}",
|
||||||
]
|
]
|
||||||
|
|
||||||
self.run_test(
|
with working_dir(test_dir):
|
||||||
"cmake",
|
cmake = self.spec["cmake"].command
|
||||||
options=cmake_args,
|
cmake(*cmake_args)
|
||||||
purpose=f"test: generate makefile for {exe} example",
|
|
||||||
work_dir=test_dir,
|
|
||||||
)
|
|
||||||
|
|
||||||
self.run_test("make", purpose=f"test: build {exe} example", work_dir=test_dir)
|
make = which("make")
|
||||||
|
make()
|
||||||
|
|
||||||
self.run_test(exe, purpose=f"test: run {exe} example", work_dir=test_dir)
|
exe = which("local_function_tasks")
|
||||||
|
exe()
|
||||||
def test(self):
|
|
||||||
self.run_local_function_tasks_test()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user