Skip to content

Commit 1cfb5c4

Browse files
committed
Diag: Stream full suite output in run-suite-with-test-bin
1 parent 17ae327 commit 1cfb5c4

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

lib/mino/tasks/builtin.clj

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -830,15 +830,29 @@
830830
"Run the full suite under `bin`, exporting MINO_TEST_BIN so
831831
subprocess-spawning tests target the binary under test rather than
832832
./mino. POSIX-only env prefix; on Windows the suite runs without
833-
the export and those tests self-skip."
833+
the export and those tests self-skip.
834+
835+
Uses `sh` (not `sh!`) and prints the binary's full combined output
836+
before checking the exit code, so a failing test's FAIL / ERROR
837+
lines and the run summary are visible in the log. `sh!` truncates
838+
captured output to 512 chars in its throw message, which hid which
839+
test actually failed."
834840
[bin extra-args]
835-
(if windows?
836-
(println (apply sh! bin (concat extra-args ["tests/run.clj"])))
837-
(println (sh! "sh" "-c"
841+
(let [res (if windows?
842+
(apply sh bin (concat extra-args ["tests/run.clj"]))
843+
(sh "sh" "-c"
838844
(str "MINO_TEST_BIN=" bin " " bin " "
839845
(str/join " " extra-args)
840846
(if (seq extra-args) " " "")
841-
"tests/run.clj")))))
847+
"tests/run.clj 2>&1")))]
848+
(print (:out res))
849+
(flush)
850+
(when (not= 0 (:exit res))
851+
(throw (ex-info (str "run-suite-with-test-bin: " bin
852+
(when (seq extra-args)
853+
(str " " (str/join " " extra-args)))
854+
" exited " (:exit res))
855+
{:bin bin :exit (:exit res)})))))
842856

843857
(def ^:private tsan-concurrency-tests
844858
"Test files that exercise real OS threads, atomics, or memory

0 commit comments

Comments
 (0)