commit c493683

shrub  ·  2026-06-12 22:05:30 +0000 UTC
parent 1dbb521
avoid rebuilding clean pre eixsting outputs on first run in ninja backend
4 files changed,  +39, -1
+2, -1
 1@@ -32,7 +32,8 @@ static void
 2 emitrule(FILE *fp, const char *cmd, int id)
 3 {
 4 	fprintf(fp, "rule r%d\n", id);
 5-	fprintf(fp, "  command = %s\n\n", cmd);
 6+	fprintf(fp, "  command = %s\n", cmd);
 7+	fprintf(fp, "  generator = 1\n\n");
 8 }
 9 
10 static char *
+5, -0
1@@ -0,0 +1,5 @@
2+all: out
3+
4+out: in
5+	@echo rebuild out
6+	@cp in out
+1, -0
1@@ -0,0 +1 @@
2+shin-make: 'out' is up to date.
+31, -0
 1@@ -0,0 +1,31 @@
 2+{
 3+  "case": "t001",
 4+  "category": "ninja",
 5+  "compare_output": true,
 6+  "description": "existing outputs should be clean on first ninja run without a .ninja_log entry",
 7+  "details": "",
 8+  "env": {},
 9+  "expected_exit": 0,
10+  "options": "out",
11+  "options_mode": "argv",
12+  "output_mode": "exact",
13+  "setup": [
14+    {
15+      "content": "input\n",
16+      "kind": "file",
17+      "mode": "0644",
18+      "mtime": 1778707200,
19+      "path": "in"
20+    },
21+    {
22+      "content": "input\n",
23+      "kind": "file",
24+      "mode": "0644",
25+      "mtime": 1778707210,
26+      "path": "out"
27+    }
28+  ],
29+  "stdin": "",
30+  "suite": "shin",
31+  "timeout_seconds": 60
32+}