summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorpsakievich <psakiev@sandia.gov>2020-09-02 19:31:58 -0600
committerGitHub <noreply@github.com>2020-09-02 20:31:58 -0500
commit7c0b356e791d1a2d601deec37866c432205eb0f3 (patch)
treef816ec0edcd9afd20d1b03ad0fdc0f24c075ff85 /var
parentced0a8f068be0a7644bab937c3f7134fbd6cc30f (diff)
downloadspack-7c0b356e791d1a2d601deec37866c432205eb0f3.tar.gz
spack-7c0b356e791d1a2d601deec37866c432205eb0f3.tar.bz2
spack-7c0b356e791d1a2d601deec37866c432205eb0f3.tar.xz
spack-7c0b356e791d1a2d601deec37866c432205eb0f3.zip
Add test tolerance variant to nalu-wind pkg (#18455)
* Add test tolerance variant to nalu-wind pkg * flake8 fixes
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/nalu-wind/package.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/nalu-wind/package.py b/var/spack/repos/builtin/packages/nalu-wind/package.py
index 38a81629a7..1e28dd8639 100644
--- a/var/spack/repos/builtin/packages/nalu-wind/package.py
+++ b/var/spack/repos/builtin/packages/nalu-wind/package.py
@@ -24,6 +24,8 @@ class NaluWind(CMakePackage):
description='Build dependencies as shared libraries')
variant('pic', default=True,
description='Position independent code')
+ variant('test_tol', default='default',
+ description='Tolerance for regression tests')
# Third party libraries
variant('openfast', default=False,
description='Compile with OpenFAST support')
@@ -122,6 +124,17 @@ class NaluWind(CMakePackage):
else:
options.append('-DENABLE_TESTS:BOOL=OFF')
+ if self.spec.variants['test_tol'].value != 'default':
+ try:
+ test_tol = float(self.spec.variants['test_tol'].value)
+ if test_tol <= 0.0:
+ raise ValueError
+ options.append('-DTEST_TOLERACE:STRING={tol}'.format(
+ tol=test_tol))
+ except ValueError:
+ print("Specified test_tol must be a positive float. "
+ "Using the default.")
+
return options
@run_before('cmake')