adios2: fix smoke package (#49647)
This commit is contained in:
parent
f0acbe4310
commit
7b3fc7dee3
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
|
||||||
|
|
||||||
from spack.build_systems.cmake import CMakeBuilder
|
from spack.build_systems.cmake import CMakeBuilder
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
@ -390,35 +389,29 @@ def test_run_executables(self):
|
|||||||
exe = which(join_path(self.prefix.bin, cmd))
|
exe = which(join_path(self.prefix.bin, cmd))
|
||||||
exe(*opts)
|
exe(*opts)
|
||||||
|
|
||||||
def test_examples(self):
|
def test_install(self):
|
||||||
"""Build and run an example program"""
|
"""Build and run an install tests"""
|
||||||
src_dir = self.test_suite.current_test_cache_dir.testing.install.C
|
srcdir = self.test_suite.current_test_cache_dir.testing.install.C
|
||||||
test_stage_dir = self.test_suite.test_dir_for_spec(self.spec)
|
blddir = self.test_suite.current_test_cache_dir.build_dir
|
||||||
|
|
||||||
# Create the build tree within this spec's test stage dir so it gets
|
cmake = Executable(self.spec["cmake"].prefix.bin.cmake)
|
||||||
# cleaned up automatically
|
cmake_args = []
|
||||||
build_dir = tempfile.mkdtemp(dir=test_stage_dir)
|
|
||||||
cmake = Executable(spec["cmake"].prefix.bin.cmake)
|
|
||||||
|
|
||||||
std_cmake_args = []
|
|
||||||
|
|
||||||
if self.spec.satisfies("+mpi"):
|
if self.spec.satisfies("+mpi"):
|
||||||
mpi_exec = join_path(self.spec["mpi"].prefix, "bin", "mpiexec")
|
mpi_exec = join_path(self.spec["mpi"].prefix, "bin", "mpiexec")
|
||||||
std_cmake_args.append(f"-DMPIEXEC_EXECUTABLE={mpi_exec}")
|
cmake_args.append(f"-DMPIEXEC_EXECUTABLE={mpi_exec}")
|
||||||
|
|
||||||
built_programs = ["adios_c_mpi_test", "adios_adios2c_test", "adios_c_test"]
|
with working_dir(blddir, create=True):
|
||||||
|
with test_part(self, "test_install_build", purpose="ADIOS2 install test build app"):
|
||||||
with working_dir(build_dir):
|
cmake(srcdir, *cmake_args)
|
||||||
with test_part(
|
|
||||||
self, "test_examples_build", purpose="build example against installed adios2"
|
|
||||||
):
|
|
||||||
cmake(src_dir, *std_cmake_args)
|
|
||||||
cmake(*(["--build", "."]))
|
cmake(*(["--build", "."]))
|
||||||
|
|
||||||
for p in built_programs:
|
for binary in ["adios_c_mpi_test", "adios_adios2c_test", "adios_c_test"]:
|
||||||
exe = which(join_path(".", p))
|
exe = which(join_path(".", binary))
|
||||||
if exe:
|
if exe:
|
||||||
with test_part(
|
with test_part(
|
||||||
self, f"test_examples_run_{p}", purpose=f"run built adios2 example {p}"
|
self,
|
||||||
|
f"test_install_run_{binary}",
|
||||||
|
purpose=f"ADIOS2 install test run {binary}",
|
||||||
):
|
):
|
||||||
exe()
|
exe()
|
||||||
|
Loading…
Reference in New Issue
Block a user