summaryrefslogtreecommitdiff
path: root/status
diff options
context:
space:
mode:
authorRene Rivera <grafikrobot@gmail.com>2016-08-11 13:53:09 -0500
committerRene Rivera <grafikrobot@gmail.com>2016-08-11 14:54:01 -0500
commitb6fec7133bfed1fc34cfc78f8f432429683e4110 (patch)
treeb00fddb85432a33c58ed4c9482f3c5c5115d8737 /status
parent7653e4d62b4533a7711a6fe73fff747b658479de (diff)
downloadboost-b6fec7133bfed1fc34cfc78f8f432429683e4110.tar.gz
Add ability to exclude tests with options. And make the filtering as to
which tests to run from status dir composable. This hopefully goes a long way towards easier control of running limited set of tests.
Diffstat (limited to 'status')
-rw-r--r--status/Jamfile.v280
1 files changed, 70 insertions, 10 deletions
diff --git a/status/Jamfile.v2 b/status/Jamfile.v2
index a7718dc628..6d77de0280 100644
--- a/status/Jamfile.v2
+++ b/status/Jamfile.v2
@@ -4,6 +4,45 @@
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
+# This build project manages running the tests for all of Boost.
+# The tests to run are discovered from the structure of the libs tree.
+#
+# Usage:
+#
+# > cd boost-root/status
+# > b2 [--check-libs-only] [--limit-tests=/lib-name-regex../]* [--exclude-tests=/lib-name-regex../]*
+#
+# --check-libs-only
+# Only runs the library conformance tests.
+#
+# --limit-tests, or --include-tests
+# Only runs the tests for whom the name matches the regex.
+# The value for the argument is a comma separated list of simple
+# regular expressions to check against the names of all the libraries.
+# If any one regex matches the matching library is tested.
+#
+# --exclude-tests
+# Only runs the tests for whom the names does not match the regex.
+# The argument is the same as for the limit-tests option except
+# that the result is that libraries for whom the name matches
+# are not tested.
+#
+# The test filters are evaluated in the order given in the command
+# and can be used to selectively narrow or widen the set of libraries
+# tested.
+#
+# Examples:
+#
+# > b2 --check-libs-only --include-tests=predef,config
+#
+# Runs the library conformance tests for the predef and config
+# libraries only.
+#
+# > b2 --include-tests=[n-t] --exclude-tests=rat --limit-tests=[v-w]
+#
+# Runs all the tests for library names that begin with "n" through "t",
+# or "v" through "w", but not libraries that start with "rat".
+
project status
: source-location $(BOOST_ROOT)
: requirements <hardcode-dll-paths>true
@@ -16,6 +55,7 @@ import regex ;
import modules ;
import path ;
import feature ;
+import numbers ;
local check-libs-only = [ MATCH "^--(check-libs-only)" : [ modules.peek : ARGV ] ] ;
local check-libs-only-targets = ;
@@ -23,7 +63,25 @@ local libraries = ;
local rule run-tests ( root : tests * )
{
- local limit-tests = [ MATCH "^--limit-tests=(.*)" : [ modules.peek : ARGV ] ] ;
+ local filter-args = [ MATCH "^--(limit|exclude|include)-tests=(.*)" : [ modules.peek : ARGV ] ] ;
+ local filter-tests ;
+ while $(filter-args)
+ {
+ local type = $(filter-args[1]) ;
+ for local test in [ regex.split-list $(filter-args[2]) : "[,]" ]
+ {
+ filter-tests += $(type) $(test) ;
+ }
+ filter-args = $(filter-args[3-]) ;
+ }
+ # If any filter is given we make the initial set of tested libraries we:
+ # (a) make it empty if the first filter is an include.
+ # (b) make it full otherwise.
+ local include-default = y ;
+ if $(filter-tests[1]) && ( $(filter-tests[1]) in limit include )
+ {
+ include-default = n ;
+ }
local location = [ project.attribute $(__name__) location ] ;
# We only run the check library test when host-os == target-os.
# Hence we need that information.
@@ -35,16 +93,22 @@ local rule run-tests ( root : tests * )
{
library = $(test) ;
}
- if $(limit-tests)
+ local include-test = $(include-default) ;
+ local t = 1 ;
+ local f = 2 ;
+ while $(filter-tests[$(f)])
{
- if ! [ MATCH "^($(limit-tests))" : $(test) ]
+ if [ MATCH "^($(filter-tests[$(f)]))" : $(test) ]
{
- library = ;
+ if $(filter-tests[$(t)]) = exclude { include-test = n ; }
+ else { include-test = y ; }
}
+ t = [ CALC $(t) + 2 ] ;
+ f = [ CALC $(f) + 2 ] ;
}
- if $(library)
+ use-project /boost/$(test) : ../$(root)/$(test) ;
+ if $(include-test) = y
{
- use-project /boost/$(test) : ../$(root)/$(test) ;
if $(root) = libs && ( ! ( $(library) in $(libraries) ) )
{
libraries += $(library) ;
@@ -76,10 +140,6 @@ local rule run-tests ( root : tests * )
build-project ../$(root)/$(test) ;
}
}
- else
- {
- use-project /boost/$(test) : ../$(root)/$(test) ;
- }
}
}