diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2016-10-18 18:55:53 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:29 +0200 |
commit | f6cc4a1f8c33f569e37220b21ea9457ebdc69b67 (patch) | |
tree | e607af7009d70f9537ca4c0d06a9b7ffd354e7a5 /build2/test/script/parser.cxx | |
parent | 24f3e34e6c1cec0500cfa6c22285e4677361b3a7 (diff) |
Print full test info in test runner
Diffstat (limited to 'build2/test/script/parser.cxx')
-rw-r--r-- | build2/test/script/parser.cxx | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index 626bc38..b670956 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -172,8 +172,7 @@ namespace build2 pending p (pending::program); // Ordered sequence of here-document redirects that we can expect to - // see after the command line. We temporarily store the end marker - // as the redirect's value. + // see after the command line. // vector<reference_wrapper<redirect>> hd; @@ -182,6 +181,12 @@ namespace build2 // auto add_word = [&ts, &p, &hd, this] (string&& w, const location& l) { + auto add_heredoc = [&w, &hd] (redirect& r) + { + hd.push_back (r); + r.end_marker = move (w); + }; + switch (p) { case pending::none: ts.arguments.push_back (move (w)); break; @@ -200,13 +205,11 @@ namespace build2 } break; } - case pending::in_document: hd.push_back (ts.in); // Fall through. - case pending::in_string: ts.in.value = move (w); break; - - case pending::out_document: hd.push_back (ts.out); // Fall through. + case pending::in_document: add_heredoc (ts.in); break; + case pending::in_string: ts.in.value = move (w); break; + case pending::out_document: add_heredoc (ts.out); break; case pending::out_string: ts.out.value = move (w); break; - - case pending::err_document: hd.push_back (ts.err); // Fall through. + case pending::err_document: add_heredoc (ts.err); break; case pending::err_string: ts.err.value = move (w); break; } @@ -541,9 +544,7 @@ namespace build2 mode (lexer_mode::here_line); next (t, tt); - // The end marker is temporarily stored as the redirect's value. - // - r.value = parse_here_document (t, tt, r.value); + r.value = parse_here_document (t, tt, r.end_marker); expire_mode (); } |