aboutsummaryrefslogtreecommitdiff
path: root/build2/test/rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/rule.cxx')
-rw-r--r--build2/test/rule.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/build2/test/rule.cxx b/build2/test/rule.cxx
index 0abc233..a8adb9e 100644
--- a/build2/test/rule.cxx
+++ b/build2/test/rule.cxx
@@ -68,8 +68,8 @@ namespace build2
// We treat this target as testable unless the test variable is
// explicitly set to false.
//
- lookup l (t["test"]);
- md.test = !l || cast<path> (l).string () != "false";
+ const name* n (cast_null<name> (t["test"]));
+ md.test = n == nullptr || !n->simple () || n->value != "false";
break;
}
}
@@ -88,14 +88,15 @@ namespace build2
// Use lookup depths to figure out who "overrides" whom.
//
auto p (t.find ("test"));
+ const name* n (cast_null<name> (p.first));
- if (p.first && cast<path> (p.first).string () != "false")
+ if (n != nullptr && n->simple () && n->value != "false")
md.test = true;
else
{
- auto test = [&t, &p] (const char* n)
+ auto test = [&t, &p] (const char* var)
{
- return t.find (n).second < p.second;
+ return t.find (var).second < p.second;
};
md.test =