diff options
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin/packages/axom/package.py | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/var/spack/repos/builtin/packages/axom/package.py b/var/spack/repos/builtin/packages/axom/package.py index c3ebe66c9d..5791fa3df9 100644 --- a/var/spack/repos/builtin/packages/axom/package.py +++ b/var/spack/repos/builtin/packages/axom/package.py @@ -3,7 +3,6 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -import glob import os import shutil import socket @@ -41,6 +40,8 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): git = "https://github.com/LLNL/axom.git" tags = ["radiuss"] + test_requires_compiler = True + license("BSD-3-Clause") version("main", branch="main") @@ -620,34 +621,29 @@ class Axom(CachedCMakePackage, CudaPackage, ROCmPackage): @run_after("install") @on_package_attributes(run_tests=True) - def check_install(self): - """ - Checks the spack install of axom using axom's - using-with-cmake example - """ - - print("Checking Axom installation...") - spec = self.spec - install_prefix = spec.prefix - example_src_dir = join_path(install_prefix, "examples", "axom", "using-with-cmake") - example_build_dir = join_path(example_src_dir, "build") - print("Checking using-with-cmake example...") - with working_dir(example_build_dir, create=True): + def test_install_using_cmake(self): + """build example with cmake and run""" + example_src_dir = join_path(self.prefix.examples.axom, "using-with-cmake") + example_stage_dir = "./cmake" + shutil.copytree(example_src_dir, example_stage_dir) + with working_dir(join_path(example_stage_dir, "build"), create=True): cmake_args = ["-C ../host-config.cmake", example_src_dir] + cmake = self.spec["cmake"].command cmake(*cmake_args) make() example = Executable("./example") example() - print("Checking using-with-make example...") - example_src_dir = join_path(install_prefix, "examples", "axom", "using-with-make") - example_build_dir = join_path(example_src_dir, "build") - example_files = glob.glob(join_path(example_src_dir, "*")) - with working_dir(example_build_dir, create=True): - for example_file in example_files: - shutil.copy(example_file, ".") - make("AXOM_DIR={0}".format(install_prefix)) + make("clean") + + @run_after("install") + @on_package_attributes(run_tests=True) + def test_install_using_make(self): + """build example with make and run""" + example_src_dir = join_path(self.prefix.examples.axom, "using-with-make") + example_stage_dir = "./make" + shutil.copytree(example_src_dir, example_stage_dir) + with working_dir(example_stage_dir, create=True): + make(f"AXOM_DIR={self.prefix}") example = Executable("./example") example() - - def test_install(self): - self.check_install() + make("clean") |