diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-15 23:59:53 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2017-10-17 01:26:31 -0700 |
commit | d14816cbafdae7e78beee2910ec0827db16122ef (patch) | |
tree | 5dc265c0c1ee7e979dcbb51184f792f83a7361e3 /var | |
parent | 44bebd7a8f0ed398abb12e20231e2acd2226c691 (diff) | |
download | spack-d14816cbafdae7e78beee2910ec0827db16122ef.tar.gz spack-d14816cbafdae7e78beee2910ec0827db16122ef.tar.bz2 spack-d14816cbafdae7e78beee2910ec0827db16122ef.tar.xz spack-d14816cbafdae7e78beee2910ec0827db16122ef.zip |
Spack tests no longer clutter var/spack/stage
- Tests use a session-scoped mock stage directory so as not to interfere
with the real install.
- Every test is forced to clean up after itself with an additional check.
We now automatically assert that no new files have been added to
`spack.stage_path` during each test.
- This means that tests that fail installs now need to clean up their
stages, but in all other cases the check is useful.
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/canfail/package.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/var/spack/repos/builtin.mock/packages/canfail/package.py b/var/spack/repos/builtin.mock/packages/canfail/package.py index 60272a529d..965ade531e 100644 --- a/var/spack/repos/builtin.mock/packages/canfail/package.py +++ b/var/spack/repos/builtin.mock/packages/canfail/package.py @@ -33,11 +33,9 @@ class Canfail(Package): version('1.0', '0123456789abcdef0123456789abcdef') + succeed = False + def install(self, spec, prefix): - try: - succeed = getattr(self, 'succeed') - if not succeed: - raise InstallError("'succeed' was false") - touch(join_path(prefix, 'an_installation_file')) - except AttributeError: - raise InstallError("'succeed' attribute was not set") + if not self.succeed: + raise InstallError("'succeed' was false") + touch(join_path(prefix, 'an_installation_file')) |