aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/runner.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-03-16 15:55:04 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-03-16 15:59:16 +0300
commitd2b324a72fdf16fcd68e6ba7ca0280aa95de4b71 (patch)
tree08294a644e4e944280f561058248a332ac00874a /build2/test/script/runner.cxx
parent5f55069b5bd01f2d5c157fa360fda400da6ba01f (diff)
Add support for >! test command redirect
Diffstat (limited to 'build2/test/script/runner.cxx')
-rw-r--r--build2/test/script/runner.cxx34
1 files changed, 13 insertions, 21 deletions
diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx
index c7b8dab..464c1f9 100644
--- a/build2/test/script/runner.cxx
+++ b/build2/test/script/runner.cxx
@@ -853,23 +853,6 @@ namespace build2
//
// set [-e|--exact] [(-n|--newline)|(-w|--whitespace)] [<attr>] <var>
//
- // -e|--exact
- // Unless the option is specified, a single final newline is ignored
- // in the input.
- //
- // -n|--newline
- // Split the input into a list of elements at newlines, including a
- // final blank element in case of -e. Multiple consecutive newlines
- // are not collapsed.
- //
- // -w|--whitespace
- // Split the input into a list of elements at whitespaces, including a
- // final blank element in case of -e. Multiple consecutive whitespaces
- // (including newlines) are collapsed.
- //
- // If the attr argument is specified, then it must contain a list of
- // value attributes enclosed in [].
- //
static void
set_builtin (scope& sp,
const strings& args,
@@ -1223,6 +1206,7 @@ namespace build2
break;
}
+ case redirect_type::trace:
case redirect_type::merge:
case redirect_type::here_str_regex:
case redirect_type::here_doc_regex:
@@ -1267,9 +1251,11 @@ namespace build2
// Open a file for command output redirect if requested explicitly
// (file overwrite/append redirects) or for the purpose of the output
// validation (none, here_*, file comparison redirects), register the
- // file for cleanup, return the file descriptor. Return nullfd,
- // standard stream descriptor duplicate or null-device descriptor for
- // merge, pass or null redirects respectively (not opening any file).
+ // file for cleanup, return the file descriptor. Interpret trace
+ // redirect according to the verbosity level (as null if below 2, as
+ // pass otherwise). Return nullfd, standard stream descriptor duplicate
+ // or null-device descriptor for merge, pass or null redirects
+ // respectively (not opening any file).
//
auto open = [&sp, &ll, &std_path] (const redirect& r,
int dfd,
@@ -1281,7 +1267,12 @@ namespace build2
fdopen_mode m (fdopen_mode::out | fdopen_mode::create);
auto_fd fd;
- switch (r.type)
+ redirect_type rt (r.type != redirect_type::trace
+ ? r.type
+ : verb < 2
+ ? redirect_type::null
+ : redirect_type::pass);
+ switch (rt)
{
case redirect_type::pass:
{
@@ -1351,6 +1342,7 @@ namespace build2
break;
}
+ case redirect_type::trace:
case redirect_type::here_doc_ref: assert (false); break;
}