aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/test/script/runner.cxx14
-rw-r--r--tests/test/script/buildfile2
2 files changed, 15 insertions, 1 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index ef086f5..8e336a3 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -193,6 +193,12 @@ namespace build2
//
assert (empty (sp.wd_path));
+ // We don't change the current directory here but indicate that the
+ // scope test commands will be executed in that directory.
+ //
+ if (verb >= 2)
+ text << "cd " << sp.wd_path;
+
sp.clean ({cleanup_type::always, sp.wd_path}, true);
}
@@ -272,6 +278,14 @@ namespace build2
fail (ll) << "registered for cleanup file " << p
<< " does not exist";
}
+
+ // Return to the parent scope directory or to the out_base one for the
+ // script scope.
+ //
+ if (verb >= 2)
+ text << "cd " << (sp.parent != nullptr
+ ? sp.parent->wd_path
+ : sp.wd_path.directory ());
}
void concurrent_runner::
diff --git a/tests/test/script/buildfile b/tests/test/script/buildfile
index 82af4dd..2c98193 100644
--- a/tests/test/script/buildfile
+++ b/tests/test/script/buildfile
@@ -2,6 +2,6 @@
# copyright : Copyright (c) 2014-2016 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-d = builtin/ runner/ integration/
+d = builtin/ integration/ runner/
./: $d
include $d