From 0a4f6bd240a512dadc54afd3116d8b8d03879de4 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 23 Nov 2016 02:57:08 +0300 Subject: Print test scope directory changes in verbose (-v) mode --- build2/test/script/runner.cxx | 14 ++++++++++++++ tests/test/script/buildfile | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) 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 -- cgit v1.1