File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,6 +123,19 @@ touch src/main.cpp
123123grep -q " GENERATE" b3.log && {
124124 cat b3.log; echo " FAIL: the action re-ran although its inputs were unchanged" ; exit 1; }
125125
126+ # ── 2b. changing the action's COMMAND also takes effect ────────────────────
127+ # Distinct from 2: there the action's declared INPUT changed and ninja noticed.
128+ # Here nothing ninja tracks changed — only build.mcpp, which re-runs (its own
129+ # source is part of its cache key), re-declares the action with a different
130+ # command, and ninja re-runs the edge because the rule's command changed. Both
131+ # halves have to work or an edited generator invocation is silently ignored.
132+ sed -i ' s|"/data/value.txt"|"/data/other.txt"|g' build.mcpp
133+ echo " 31" > data/other.txt
134+ " $MCPP " build > b2b.log 2>&1 || { cat b2b.log; echo " FAIL: rebuild after editing build.mcpp failed" ; exit 1; }
135+ out=" $( " $MCPP " run 2>&1 | grep ' ^VALUE=' | tail -1) "
136+ [[ " $out " == " VALUE=31" ]] || {
137+ cat b2b.log; echo " FAIL: an edited action command did not take effect: $out " ; exit 1; }
138+
126139# ── 3. a failing check fails the build ─────────────────────────────────────
127140touch FAIL_THE_CHECK
128141rm -f " $OUTDIR /lint.stamp"
You can’t perform that action at this time.
0 commit comments