AMReX Smoke Test (#27411)
This commit is contained in:
parent
1ea4497802
commit
eda565f3b1
@ -15,6 +15,8 @@ class Amrex(CMakePackage, CudaPackage, ROCmPackage):
|
||||
url = "https://github.com/AMReX-Codes/amrex/releases/download/22.01/amrex-22.01.tar.gz"
|
||||
git = "https://github.com/AMReX-Codes/amrex.git"
|
||||
|
||||
test_requires_compiler = True
|
||||
|
||||
tags = ['ecp', 'e4s']
|
||||
|
||||
maintainers = ['WeiqunZhang', 'asalmgren']
|
||||
@ -244,3 +246,57 @@ def cmake_args(self):
|
||||
args.append('-DCUDA_ARCH=' + self.get_cuda_arch_string(cuda_arch))
|
||||
|
||||
return args
|
||||
|
||||
# TODO: Replace this method and its 'get' use for cmake path with
|
||||
# join_path(self.spec['cmake'].prefix.bin, 'cmake') once stand-alone
|
||||
# tests can access build dependencies through self.spec['cmake'].
|
||||
def cmake_bin(self, set=True):
|
||||
"""(Hack) Set/get cmake dependency path."""
|
||||
filepath = join_path(self.install_test_root, 'cmake_bin_path.txt')
|
||||
if set:
|
||||
with open(filepath, 'w') as out_file:
|
||||
cmake_bin = join_path(self.spec['cmake'].prefix.bin, 'cmake')
|
||||
out_file.write('{0}\n'.format(cmake_bin))
|
||||
else:
|
||||
with open(filepath, 'r') as in_file:
|
||||
return in_file.read().strip()
|
||||
|
||||
@run_after('build')
|
||||
def setup_smoke_test(self):
|
||||
"""Skip setup smoke tests for AMReX versions less than 21.12."""
|
||||
if self.spec.satisfies('@:21.11'):
|
||||
return
|
||||
|
||||
self.cache_extra_test_sources(['Tests'])
|
||||
|
||||
# TODO: Remove once self.spec['cmake'] is available here
|
||||
self.cmake_bin(set=True)
|
||||
|
||||
def test(self):
|
||||
"""Skip smoke tests for AMReX versions less than 21.12."""
|
||||
if self.spec.satisfies('@:21.11'):
|
||||
print("SKIPPED: Stand-alone tests not supported for this version of AMReX.")
|
||||
return
|
||||
|
||||
"""Perform smoke tests on installed package."""
|
||||
# TODO: Remove/replace once self.spec['cmake'] is available here
|
||||
cmake_bin = self.cmake_bin(set=False)
|
||||
|
||||
args = []
|
||||
args.append('-S./cache/amrex/Tests/SpackSmokeTest')
|
||||
args.append('-DAMReX_ROOT=' + self.prefix)
|
||||
args.append('-DMPI_C_COMPILER=' + self.spec['mpi'].mpicc)
|
||||
args.append('-DMPI_CXX_COMPILER=' + self.spec['mpi'].mpicxx)
|
||||
args.extend(self.cmake_args())
|
||||
self.run_test(cmake_bin,
|
||||
args,
|
||||
purpose='Build with same CMake version as install')
|
||||
|
||||
make()
|
||||
|
||||
self.run_test('install_test',
|
||||
['./cache/amrex/Tests/Amr/Advection_AmrCore/Exec/inputs-ci'],
|
||||
['finalized'],
|
||||
installed=False,
|
||||
purpose='AMReX Stand-Alone Smoke Test -- AmrCore',
|
||||
skip_missing=False)
|
||||
|
Loading…
Reference in New Issue
Block a user