aboutsummaryrefslogtreecommitdiff
path: root/build2/test
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-12-07 12:06:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-12-07 12:06:59 +0200
commita89f1e4f4efd291beedea03c65c8185b7d0df20e (patch)
treed06b2cb81720ae0c6cc877c2c67201838a10b63a /build2/test
parentc2da5df68610a0070575212bfee67c730ab39128 (diff)
Distinguish between "fixed" and "default" target extensions
This fixes wrong merging of, say, file{README} and file{README.MySQL} (in libmysqlclient).
Diffstat (limited to 'build2/test')
-rw-r--r--build2/test/target.cxx23
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,