rocm-clang-ocl: old to new test API (#44938)

* rocm-ocl-clang: old to new test format
* Minor cleanup

---------

Co-authored-by: Tamara Dahlgren <dahlgren1@llnl.gov>
This commit is contained in:
AcriusWinter 2024-07-12 14:56:38 -07:00 committed by GitHub
parent e2b6eca420
commit 2ca733bbc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -14,6 +14,8 @@ class RocmClangOcl(CMakePackage):
url = "https://github.com/ROCm/clang-ocl/archive/rocm-6.1.2.tar.gz"
tags = ["rocm"]
test_requires_compiler = True
license("MIT")
maintainers("srekolam", "renjithravindrankannath")
@ -83,12 +85,11 @@ def cache_test_sources(self):
install test subdirectory for use during `spack test run`."""
self.cache_extra_test_sources([self.test_src_dir])
def test(self):
def test_make(self):
"""Test make"""
test_dir = join_path(self.test_suite.current_test_cache_dir, self.test_src_dir)
with working_dir(test_dir, create=True):
cmake_bin = join_path(self.spec["cmake"].prefix.bin, "cmake")
prefixes = ";".join([self.spec["rocm-clang-ocl"].prefix])
cc_options = ["-DCMAKE_PREFIX_PATH=" + prefixes, "."]
self.run_test(cmake_bin, cc_options)
with working_dir(test_dir):
cmake = self.spec["cmake"].command
cmake("-DCMAKE_PREFIX_PATH=" + self.spec["rocm-clang-ocl"].prefix, ".")
make = which("make")
make()
make("clean")