aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script.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/script.cxx
parent33ed305eac57bff406fa3f672ba8acc4941e8f13 (diff)
Implement support for narrowing down tests (config.test)
Diffstat (limited to 'build2/test/script/script.cxx')
-rw-r--r--build2/test/script/script.cxx22
1 files changed, 6 insertions, 16 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx
index 661ec7f..2a34f66 100644
--- a/build2/test/script/script.cxx
+++ b/build2/test/script/script.cxx
@@ -424,24 +424,11 @@ namespace build2
// script
//
- static inline string
- script_id (const path& p)
- {
- string r (p.leaf ().string ());
-
- if (r == "testscript")
- return string ();
-
- size_t n (path::traits::find_extension (r));
- assert (n != string::npos);
- r.resize (n);
- return r;
- }
-
script::
script (target& tt, testscript& st, const dir_path& rwd)
- : group (script_id (st.path ())),
- test_target (tt), script_target (st)
+ : group (st.name == "testscript" ? string () : st.name),
+ test_target (tt),
+ script_target (st)
{
// Set the script working dir ($~) to $out_base/test/<id> (id_path
// for root is just the id which is empty if st is 'testscript').
@@ -458,7 +445,10 @@ namespace build2
//
lookup l (find_in_buildfile ("test", false));
+ // Note that we have similar code for simple tests.
+ //
target* t (nullptr);
+
if (l.defined ())
{
const name* n (cast_null<name> (l));