aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/test/script/runner.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 000b605..13f7f8a 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -1594,7 +1594,7 @@ namespace build2
catch (const system_error& e)
{
fail (ll) << "unable to execute " << c.program << " builtin: "
- << e << endf;
+ << e;
}
}
else
@@ -1603,6 +1603,27 @@ namespace build2
//
cstrings args (process_args ());
+ // Resolve the relative not simple program path against the scope's
+ // working directory. The simple one will be left for the process
+ // path search machinery.
+ //
+ path p;
+
+ try
+ {
+ p = path (args[0]);
+
+ if (p.relative () && !p.simple ())
+ {
+ p = sp.wd_path / p;
+ args[0] = p.string ().c_str ();
+ }
+ }
+ catch (const invalid_path& e)
+ {
+ fail (ll) << "invalid program path " << e.path;
+ }
+
try
{
process_path pp (process::path_search (args[0]));