summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2021-05-25 12:10:19 -0400
committerGitHub <noreply@github.com>2021-05-25 10:10:19 -0600
commita284edb8527d386a9525940ecb79207ad38a1f54 (patch)
tree8880be2855930732a44c8d59a35cf78bb653265f
parent29deb399b4eefac931e7bb114e11772196433a43 (diff)
downloadspack-a284edb8527d386a9525940ecb79207ad38a1f54.tar.gz
spack-a284edb8527d386a9525940ecb79207ad38a1f54.tar.bz2
spack-a284edb8527d386a9525940ecb79207ad38a1f54.tar.xz
spack-a284edb8527d386a9525940ecb79207ad38a1f54.zip
ForTrilinos: add smoke test (#23664)
-rw-r--r--var/spack/repos/builtin/packages/fortrilinos/package.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/fortrilinos/package.py b/var/spack/repos/builtin/packages/fortrilinos/package.py
index e693a2cbc0..fb96f87f2f 100644
--- a/var/spack/repos/builtin/packages/fortrilinos/package.py
+++ b/var/spack/repos/builtin/packages/fortrilinos/package.py
@@ -29,6 +29,8 @@ class Fortrilinos(CMakePackage):
maintainers = ['sethrj', 'aprokop']
+ test_requires_compiler = True
+
version('2.0.0', sha256='9af3b3eea9934e44d74654a5fa822de08bd0efa43e06e4a4e35a777781f542d6')
# Note: spack version comparison implies Version('2.0.0') <
# Version('2.0.0-dev1'), so this is the best workaround I could find.
@@ -72,3 +74,27 @@ class Fortrilinos(CMakePackage):
self.define('ForTrilinos_EXAMPLES', self.run_tests),
self.define('ForTrilinos_TESTING', self.run_tests),
]
+
+ examples_src_dir = 'example/test-installation'
+
+ @run_after('install')
+ def setup_smoke_tests(self):
+ """Copy the example source files after the package is installed to an
+ install test subdirectory for use during `spack test run`."""
+ self.cache_extra_test_sources([self.examples_src_dir])
+
+ def test(self):
+ example_src_dir = join_path(self.install_test_root,
+ self.examples_src_dir)
+ test_build_dir = join_path(self.test_suite.stage,
+ 'build_example')
+ with working_dir(test_build_dir, create=True):
+ cmake(
+ self.define('CMAKE_PREFIX_PATH', self.prefix),
+ self.define('CMAKE_CXX_COMPILER', self.compiler.cxx),
+ self.define('CMAKE_Fortran_COMPILER', self.compiler.fc),
+ example_src_dir
+ )
+ make()
+ self.run_test('ctest', ['-V'], [], installed=False,
+ purpose='test: installation')