aboutsummaryrefslogtreecommitdiff
path: root/build2/test/target.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/target.cxx')
-rw-r--r--build2/test/target.cxx19
1 files changed, 12 insertions, 7 deletions
diff --git a/build2/test/target.cxx b/build2/test/target.cxx
index a517240..25afd0d 100644
--- a/build2/test/target.cxx
+++ b/build2/test/target.cxx
@@ -24,19 +24,24 @@ namespace build2
testscript_target_pattern (const target_type&,
const scope&,
string& v,
+ optional<string>& e,
+ const location& l,
bool r)
{
- size_t p (path::traits::find_extension (v));
-
if (r)
{
- assert (p != string::npos);
- v.resize (p);
+ assert (e);
+ e = nullopt;
}
- else if (p == string::npos && v != "testscript")
+ else
{
- v += ".test";
- return true;
+ e = target::split_name (v, l);
+
+ if (!e && v != "testscript")
+ {
+ e = "test";
+ return true;
+ }
}
return false;