diff options
-rw-r--r-- | var/spack/repos/builtin/packages/hiop/package.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/hiop/package.py b/var/spack/repos/builtin/packages/hiop/package.py index fe091f7142..ba865a321d 100644 --- a/var/spack/repos/builtin/packages/hiop/package.py +++ b/var/spack/repos/builtin/packages/hiop/package.py @@ -3,6 +3,10 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) +import os + +import llnl.util.tty as tty + from spack import * @@ -204,3 +208,36 @@ class Hiop(CMakePackage, CudaPackage, ROCmPackage): args.append(self.define('HIOP_COINHSL_DIR', spec['coinhsl'].prefix)) return args + + # If testing on a cluster without access to home directory in a job, you may + # set the following environment variables to prevent related errors: + # + # export SPACK_USER_CACHE_PATH=/tmp/spack + # export SPACK_DISABLE_LOCAL_CONFIG=true + def test(self): + if not self.spec.satisfies('@develop') or \ + not os.path.isdir(self.prefix.bin): + tty.info('Skipping: checks not installed in bin for v{0}'. + format(self.version)) + return + + tests = [ + ['NlpMdsEx1.exe', '400', '100', '0', '-selfcheck'], + ['NlpMdsEx1.exe', '400', '100', '1', '-selfcheck'], + ['NlpMdsEx1.exe', '400', '100', '0', '-empty_sp_row', '-selfcheck'], + ] + + if '+raja' in self.spec: + tests.extend([ + ['NlpMdsEx1Raja.exe', '400', '100', '0', '-selfcheck'], + ['NlpMdsEx1Raja.exe', '400', '100', '1', '-selfcheck'], + ['NlpMdsEx1Raja.exe', '400', '100', '0', '-empty_sp_row', '-selfcheck'], + ]) + + for i, test in enumerate(tests): + exe = os.path.join(self.prefix.bin, test[0]) + args = test[1:] + reason = 'test {0}: "{1}"'.format(i, ' '.join(test)) + self.run_test(exe, args, [], 0, installed=False, + purpose=reason, skip_missing=True, + work_dir=self.prefix.bin) |