From 9bf93c1ab73ee3cd2b763285fc5fc5456e972854 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 11 Jan 2017 10:14:23 +0200 Subject: Implement support for narrowing down tests (config.test) --- build2/test/script/parser.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'build2/test/script/parser.cxx') diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index da072dc..f250d27 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -2,11 +2,11 @@ // copyright : Copyright (c) 2014-2017 Code Synthesis Ltd // license : MIT; see accompanying LICENSE file +#include + #include #include // strstr() -#include - #include #include @@ -2743,6 +2743,14 @@ namespace build2 for (unique_ptr& chain: g->scopes) { + // Check if this scope is ignored (e.g., via config.test). + // + if (!runner_->test (*chain)) + { + chain.reset (); + continue; + } + // Pick a scope from the if-else chain. // // In fact, we are going to drop all but the selected (if any) -- cgit v1.1