aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-10-25 16:47:00 +0300
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:35 +0200
commitb61e9e2ba8e625a598427cc2990806b69d104a18 (patch)
tree2e4b492a2ec00b325f52753ffa456f6f90eb78f2 /build2/test/script/runner.cxx
parente3ff4880273746c34d07e641110abaf38a1f1fca (diff)
Add support of file redirects to testscript parser
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r--build2/test/script/runner.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index 995da4f..f065389 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -64,7 +64,11 @@ namespace build2
{
ofdstream os (orp);
sp.cleanups.emplace_back (orp);
- os << rd.value;
+
+ os << (rd.type == redirect_type::here_string
+ ? rd.str
+ : rd.doc.doc);
+
os.close ();
}
catch (const io_error& e)
@@ -298,11 +302,12 @@ namespace build2
so.close ();
se.close ();
- if (c.in.type == redirect_type::here_string ||
- c.in.type == redirect_type::here_document)
+ const redirect& r (c.in);
+ if (r.type == redirect_type::here_string ||
+ r.type == redirect_type::here_document)
{
ofdstream os (pr.out_fd);
- os << c.in.value;
+ os << (r.type == redirect_type::here_string ? r.str : r.doc.doc);
os.close ();
}