diff --git a/lib/spack/spack/cmd/test.py b/lib/spack/spack/cmd/test.py index ddc6cb4fce..9a85c7d270 100644 --- a/lib/spack/spack/cmd/test.py +++ b/lib/spack/spack/cmd/test.py @@ -23,6 +23,7 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ############################################################################## import os +import shutil from pprint import pprint from llnl.util.filesystem import join_path, mkdirp @@ -66,4 +67,7 @@ def test(parser, args): if not os.path.exists(outputDir): mkdirp(outputDir) + spack.cache_path = join_path(spack.var_path, "test-cache") + mkdirp(spack.cache_path) spack.test.run(args.names, outputDir, args.verbose) + shutil.rmtree(spack.cache_path) diff --git a/lib/spack/spack/test/git_fetch.py b/lib/spack/spack/test/git_fetch.py index 3578044116..76814f089a 100644 --- a/lib/spack/spack/test/git_fetch.py +++ b/lib/spack/spack/test/git_fetch.py @@ -30,6 +30,8 @@ from spack.test.mock_repo import MockGitRepo from spack.version import ver +import shutil +import os class GitFetchTest(MockPackagesTest): """Tests fetching from a dummy git repository.""" @@ -49,6 +51,8 @@ def tearDown(self): """Destroy the stage space used by this test.""" super(GitFetchTest, self).tearDown() self.repo.destroy() + for d in os.listdir(spack.cache_path): + shutil.rmtree(os.path.join(spack.cache_path, d)) def assert_rev(self, rev): """Check that the current git revision is equal to the supplied rev."""