diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-10-25 16:47:00 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:35 +0200 |
commit | b61e9e2ba8e625a598427cc2990806b69d104a18 (patch) | |
tree | 2e4b492a2ec00b325f52753ffa456f6f90eb78f2 /build2/test/script/runner.cxx | |
parent | e3ff4880273746c34d07e641110abaf38a1f1fca (diff) |
Add support of file redirects to testscript parser
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r-- | build2/test/script/runner.cxx | 13 |
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 (); } |