aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-11-10 00:26:54 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-11-15 16:46:10 +0300
commita7efabf301f23364ac2335c80c5e1e712bc43204 (patch)
treedded192f09627702bc8e0566c5c6032825d6920c /build2/test/script/runner.cxx
parent05b1d9e89a94ee5594168073b8dc363fada987f1 (diff)
Add cat, false and true builtins
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r--build2/test/script/runner.cxx21
1 files changed, 17 insertions, 4 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 1d6920a..aa35612 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -406,7 +406,8 @@ namespace build2
ifd.reset (fdnull ()); // @@ Eventually will be throwing.
if (ifd.get () == -1) // @@ TMP
- throw io_error ("", error_code (errno, system_category ()));
+ throw io_error (
+ error_code (errno, system_category ()).message ());
in = -2;
}
@@ -512,7 +513,8 @@ namespace build2
fd.reset (fdnull ()); // @@ Eventully will be throwing.
if (fd.get () == -1) // @@ TMP
- throw io_error ("", error_code (errno, system_category ()));
+ throw io_error (
+ error_code (errno, system_category ()).message ());
}
catch (const io_error& e)
{
@@ -590,13 +592,24 @@ namespace build2
}
optional<process::status_type> status;
- builtin b (builtins.find (c.program.string ()));
+ builtin* b (builtins.find (c.program.string ()));
if (b != nullptr)
{
// Execute the builtin.
//
- status = (*b) (sp, c.arguments, move (ifd), move (ofd), move (efd));
+ try
+ {
+ future<uint8_t> f (
+ (*b) (sp, c.arguments, move (ifd), move (ofd), move (efd)));
+
+ status = f.get ();
+ }
+ catch (const system_error& e)
+ {
+ fail (ll) << "unable to execute " << c.program << " builtin: "
+ << e.what ();
+ }
}
else
{