aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-01-11 10:14:23 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-01-12 10:58:19 +0200
commit9bf93c1ab73ee3cd2b763285fc5fc5456e972854 (patch)
tree0357c36e12fe2137ef6c9bd228e9d69bb2489a02 /build2/test/script/parser.cxx
parent33ed305eac57bff406fa3f672ba8acc4941e8f13 (diff)
Implement support for narrowing down tests (config.test)
Diffstat (limited to 'build2/test/script/parser.cxx')
-rw-r--r--build2/test/script/parser.cxx12
1 files changed, 10 insertions, 2 deletions
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 <build2/test/script/parser>
+
#include <sstream>
#include <cstring> // strstr()
-#include <build2/test/script/parser>
-
#include <build2/scheduler>
#include <build2/test/script/lexer>
@@ -2743,6 +2743,14 @@ namespace build2
for (unique_ptr<scope>& 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)