summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorG-Ragghianti <33492707+G-Ragghianti@users.noreply.github.com>2023-07-12 20:38:57 +0200
committerGitHub <noreply@github.com>2023-07-12 11:38:57 -0700
commitf895f80bc26a8441ea28736577dd23072872afae (patch)
tree3a75f4ff071dd5afeea7d1630a385942a432233c
parent0ca11d7033e36d4347ae5d274f809bd71dba55ac (diff)
downloadspack-f895f80bc26a8441ea28736577dd23072872afae.tar.gz
spack-f895f80bc26a8441ea28736577dd23072872afae.tar.bz2
spack-f895f80bc26a8441ea28736577dd23072872afae.tar.xz
spack-f895f80bc26a8441ea28736577dd23072872afae.zip
Package papi: update for smoke tests (#38711)
* Adding papi smoke tests * smoke tests * update to new test framework
-rw-r--r--var/spack/repos/builtin/packages/papi/package.py27
1 files changed, 25 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py
index 1adf089dcf..768196a3da 100644
--- a/var/spack/repos/builtin/packages/papi/package.py
+++ b/var/spack/repos/builtin/packages/papi/package.py
@@ -22,12 +22,12 @@ class Papi(AutotoolsPackage, ROCmPackage):
components that expose performance measurement opportunities
across the hardware and software stack."""
- homepage = "https://icl.cs.utk.edu/papi/index.html"
+ homepage = "https://icl.utk.edu/papi/"
maintainers("G-Ragghianti")
tags = ["e4s"]
- url = "https://icl.cs.utk.edu/projects/papi/downloads/papi-5.4.1.tar.gz"
+ url = "https://icl.utk.edu/projects/papi/downloads/papi-5.4.1.tar.gz"
git = "https://github.com/icl-utk-edu/papi"
version("master", branch="master")
@@ -181,3 +181,26 @@ class Papi(AutotoolsPackage, ROCmPackage):
join_path(self.prefix.lib, "libpapi.dylib"),
)
fs.fix_darwin_install_name(self.prefix.lib)
+
+ test_src_dir = "src/smoke_tests"
+ test_requires_compiler = True
+
+ @run_after("install")
+ def cache_test_sources(self):
+ """Copy the example source files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ if os.path.exists(self.test_src_dir):
+ self.cache_extra_test_sources([self.test_src_dir])
+
+ def test_smoke(self):
+ """Compile and run simple code against the installed papi library."""
+ test_dir = join_path(self.test_suite.current_test_cache_dir, self.test_src_dir)
+ if not os.path.exists(test_dir):
+ raise SkipTest("Skipping smoke tests, directory doesn't exist")
+ with working_dir(test_dir, create=False):
+ with spack.util.environment.set_env(PAPIROOT=self.prefix):
+ make()
+ exe_simple = which("simple")
+ exe_simple()
+ exe_threads = which("threads")
+ exe_threads()