commit 5b4f7994594d4e4f75d32bd8664f0af2ed8ac914
parent c75e8035ce9fa00371649b2ad83e83c5c5166b60
Author: Eyal Sawady <ecs@d2evs.net>
Date: Sun, 6 Jun 2021 22:51:11 +0000
cmd/hare: improve test discovery
By passing -T to all modules which are found under ./
Signed-off-by: Eyal Sawady <ecs@d2evs.net>
Diffstat:
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha
@@ -151,6 +151,20 @@ fn sched_hare_object(
]),
});
+ for (let i = 0z; i < len(plan.context.tags); i += 1) {
+ if (plan.context.tags[i].mode == module::tag_mode::INCLUSIVE
+ && plan.context.tags[i].name == "test") {
+ const opaths = plan.context.paths;
+ plan.context.paths = ["."];
+ const ver = module::lookup(plan.context, namespace);
+ if (ver is module::version) {
+ append(harec.cmd, "-T");
+ };
+ plan.context.paths = opaths;
+ break;
+ };
+ };
+
let current = false;
let output = if (len(namespace) != 0) {
let version = hex::encodestr(ver.hash);
@@ -201,14 +215,6 @@ fn sched_hare_object(
append(harec.cmd, "-D", plan.context.defines[i]);
};
- // XXX: This is kind of hacky too
- for (let i = 0z; i < len(plan.context.tags); i += 1) {
- if (plan.context.tags[i].mode == module::tag_mode::INCLUSIVE) {
- append(harec.cmd, "-T", strings::concat("+",
- plan.context.tags[i].name));
- };
- };
-
mkfile(plan, "o"); // TODO: Should exes go in the cache?
};