diff options
Diffstat (limited to 'build2/test/target.cxx')
-rw-r--r-- | build2/test/target.cxx | 23 |
1 files changed, 5 insertions, 18 deletions
diff --git a/build2/test/target.cxx b/build2/test/target.cxx index a85546c..0bda827 100644 --- a/build2/test/target.cxx +++ b/build2/test/target.cxx @@ -11,27 +11,13 @@ namespace build2 { namespace test { - static pair<target*, optional<string>> - testscript_factory (const target_type&, - dir_path d, - dir_path o, - string n, - optional<string> e) - { - if (!e) - e = (n == "testscript" ? string () : "test"); - - return make_pair ( - new testscript (move (d), move (o), move (n)), move (e)); - } - - static optional<string> - testscript_target_extension (const target_key& tk, const scope&, bool) + static const char* + testscript_target_extension (const target_key& tk) { // If the name is special 'testscript', then there is no extension, // otherwise it is .test. // - return *tk.name == "testscript" ? string () : "test"; + return *tk.name == "testscript" ? "" : "test"; } static bool @@ -60,8 +46,9 @@ namespace build2 { "test", &file::static_type, - &testscript_factory, + &target_factory<testscript>, &testscript_target_extension, + nullptr, /* default_extension */ &testscript_target_pattern, nullptr, &file_search, |