From 4098cdddbb3ef9830b70b3ad2f1e0610a95d9aa0 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Mon, 17 Oct 2016 16:43:29 +0300 Subject: Fix few bugs in testscript parser --- build2/test/rule.cxx | 5 +++-- build2/test/script/parser.cxx | 2 +- build2/test/script/token | 6 +++--- build2/test/script/token.cxx | 6 +++--- unit-tests/test/script/lexer/script-line.test | 4 ++++ 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx index 8621422..29d5925 100644 --- a/build2/test/rule.cxx +++ b/build2/test/rule.cxx @@ -366,7 +366,8 @@ namespace build2 const path& sp (st->path ()); assert (!sp.empty ()); // Should have been assigned by update. - text << "test " << t << " with " << *st; + if (verb) + text << "test " << t << " with " << *st; try { @@ -504,7 +505,7 @@ namespace build2 dpp = run_search (dp, true); args.push_back (dpp.recall_string ()); - args.push_back ("--strip-trailing-cr"); //@@ TMP: see module.cxx + args.push_back ("--strip-trailing-cr"); //@@ TMP: see init.cxx args.push_back ("-u"); args.push_back (ot.path ().string ().c_str ()); args.push_back ("-"); diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index 67585c6..bfd0667 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -234,7 +234,7 @@ namespace build2 unsigned long fd (3); if (!t.separated) { - if (!ts.arguments.empty ()) + if (ts.arguments.empty ()) fail (l) << "missing redirect file descriptor"; const string& s (ts.arguments.back ()); diff --git a/build2/test/script/token b/build2/test/script/token index e952e00..c39811a 100644 --- a/build2/test/script/token +++ b/build2/test/script/token @@ -33,9 +33,9 @@ namespace build2 in_string, // < in_document, // << - out_null, // ! + out_string, // > + out_document // >> }; token_type () = default; diff --git a/build2/test/script/token.cxx b/build2/test/script/token.cxx index bfff25a..27e86d6 100644 --- a/build2/test/script/token.cxx +++ b/build2/test/script/token.cxx @@ -30,9 +30,9 @@ namespace build2 case token_type::in_string: os << q << '<' << q; break; case token_type::in_document: os << q << "<<" << q; break; - case token_type::out_null: os << q << "!" << q; break; + case token_type::out_string: os << q << '>' << q; break; + case token_type::out_document: os << q << ">>" << q; break; default: build2::token_printer (os, t, d); } diff --git a/unit-tests/test/script/lexer/script-line.test b/unit-tests/test/script/lexer/script-line.test index fcde40b..6a55926 100644 --- a/unit-tests/test/script/lexer/script-line.test +++ b/unit-tests/test/script/lexer/script-line.test @@ -1,3 +1,7 @@ +a=aaa +foo bar <"bbb $a ccc" >ddd 2>>EOE +eee +EOE foo bar $cxx.target.class -- cgit v1.1