aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/script.cxx
diff options
context:
space:
mode:
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));