summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorRicharda Butler <39577672+RikkiButler20@users.noreply.github.com>2021-07-27 17:30:34 -0700
committerGitHub <noreply@github.com>2021-07-27 17:30:34 -0700
commitaf468235e2e3d53b5cd47064e1c9e20ca13eebfc (patch)
tree90bf4dcd0c720cb3ac0b4dc4d6e4edfe5e3cc9e5 /var
parentc8efec02957b6381979a952156d8ef64fd792e3a (diff)
downloadspack-af468235e2e3d53b5cd47064e1c9e20ca13eebfc.tar.gz
spack-af468235e2e3d53b5cd47064e1c9e20ca13eebfc.tar.bz2
spack-af468235e2e3d53b5cd47064e1c9e20ca13eebfc.tar.xz
spack-af468235e2e3d53b5cd47064e1c9e20ca13eebfc.zip
AML: Add E4S testsuite stand alone test (#23874)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/aml/package.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/aml/package.py b/var/spack/repos/builtin/packages/aml/package.py
index e647f26938..f282067300 100644
--- a/var/spack/repos/builtin/packages/aml/package.py
+++ b/var/spack/repos/builtin/packages/aml/package.py
@@ -3,6 +3,8 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+import os
+
from spack import *
@@ -13,6 +15,8 @@ class Aml(AutotoolsPackage):
url = "https://www.mcs.anl.gov/research/projects/argo/downloads/aml-0.1.0.tar.gz"
git = "https://xgitlab.cels.anl.gov/argo/aml.git"
+ test_requires_compiler = True
+
version('0.1.0', sha256='cc89a8768693f1f11539378b21cdca9f0ce3fc5cb564f9b3e4154a051dcea69b')
version('develop', branch='staging', submodules=True)
version('master', branch='master', submodules=True)
@@ -23,3 +27,39 @@ class Aml(AutotoolsPackage):
depends_on('autoconf', type='build')
depends_on('automake', type='build')
depends_on('libtool', type='build')
+
+ @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`."""
+ self.cache_extra_test_sources(['tests', join_path('include', 'config.h')])
+
+ def run_area_test(self):
+ """Run stand alone test: test_area"""
+
+ test_dir = join_path(self.test_suite.current_test_cache_dir, 'tests', 'area')
+
+ if not os.path.exists(test_dir):
+ print('Skipping aml test')
+ return
+
+ exe = 'test_area'
+
+ self.run_test('gcc',
+ options=['-o', exe, join_path(test_dir, 'test_area.c'),
+ '-I{0}'.format(join_path(
+ self.test_suite.current_test_cache_dir,
+ 'include')),
+ '-I{0}'.format(self.prefix.include),
+ '-I{0}'.format(self.spec['numactl'].prefix.include),
+ '-L{0}'.format(self.prefix.lib),
+ '-laml', '-lexcit', '-lpthread'],
+ purpose='test: compile {0} example'.format(exe),
+ work_dir=test_dir)
+
+ self.run_test(exe,
+ purpose='test: run {0} example'.format(exe),
+ work_dir=test_dir)
+
+ def test(self):
+ self.run_area_test()