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/runner.cxx | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'build2/test/script/runner.cxx') diff --git a/build2/test/script/runner.cxx b/build2/test/script/runner.cxx index 64c6e87..522dedd 100644 --- a/build2/test/script/runner.cxx +++ b/build2/test/script/runner.cxx @@ -10,6 +10,9 @@ #include // fdopen_mode, fdnull(), fddup() #include + +#include + #include using namespace std; @@ -310,21 +313,26 @@ namespace build2 } } + bool default_runner:: + test (scope& s) const + { + return common_.test (s.root->test_target, s.id_path); + } + void default_runner:: enter (scope& sp, const location&) { - if (!exists (sp.wd_path)) - // @@ Shouldn't we add an optional location parameter to mkdir() and - // alike utility functions so the failure message can contain - // location info? - // - mkdir (sp.wd_path, 2); - else - // Scope working directory shall be empty (the script working - // directory is cleaned up by the test rule prior the script - // execution). - // - assert (empty (sp.wd_path)); + // Scope working directory shall be empty (the script working + // directory is cleaned up by the test rule prior the script + // execution). + // + // @@ Shouldn't we add an optional location parameter to mkdir() and + // alike utility functions so the failure message can contain + // location info? + // + if (mkdir (sp.wd_path, 2) == mkdir_status::already_exists) + fail << "working directory " << sp.wd_path << " already exists" << + info << "are tests stomping on each other's feet?"; // We don't change the current directory here but indicate that the // scope test commands will be executed in that directory. -- cgit v1.1