diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 0d7b188b73..4f017f50eb 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1126,7 +1126,7 @@ def check_performance(self): for tag, expr in self.perf_patterns.items(): value = evaluate(expr) key = '%s:%s' % (self._current_partition.fullname, tag) - if not key in self.reference: + if key not in self.reference: raise SanityError( "tag `%s' not resolved in references for `%s'" % (tag, self._current_partition.fullname)) @@ -1158,10 +1158,14 @@ def _copy_to_outputdir(self): # Copy files specified by the user for f in self.keep_files: + f_orig = f if not os.path.isabs(f): f = os.path.join(self._stagedir, f) - shutil.copy(f, self.outputdir) + if os.path.isfile(f): + shutil.copy(f, self.outputdir) + elif os.path.isdir(f): + shutil.copytree(f, os.path.join(self.outputdir, f_orig)) def cleanup(self, remove_files=False, unload_env=True): """The cleanup phase of the regression test pipeline. diff --git a/unittests/test_pipeline.py b/unittests/test_pipeline.py index 3edbc3047e..b23a2b4050 100644 --- a/unittests/test_pipeline.py +++ b/unittests/test_pipeline.py @@ -117,9 +117,10 @@ def test_hellocheck_local(self): test.valid_prog_environs = [self.progenv.name] # Test also the prebuild/postbuild functionality - test.prebuild_cmd = ['touch prebuild'] - test.postbuild_cmd = ['touch postbuild'] - test.keep_files = ['prebuild', 'postbuild'] + test.prebuild_cmd = ['touch prebuild', 'mkdir prebuild_dir'] + test.postbuild_cmd = ['touch postbuild', 'mkdir postbuild_dir'] + test.keep_files = ['prebuild', 'postbuild', + 'prebuild_dir', 'postbuild_dir'] # Force local execution of the test test.local = True