From 7c0cc0d2cbaf6427bf31f0704e8a8b2865c5a74e Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 7 Nov 2026 10:21:27 -1000 Subject: Fail a unit check run that made no check --- tests/extensions/harness.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests') diff --git a/tests/extensions/harness.lua b/tests/extensions/harness.lua index b54f727..1e2fe08 100644 --- a/tests/extensions/harness.lua +++ b/tests/extensions/harness.lua @@ -279,11 +279,16 @@ function harness.excludes(name, haystack, needle) end end +-- A run that made no check proves nothing, so it fails as well. function harness.finish() if failures > 0 then io.write(failures, " of ", checks, " checks failed\n") os.exit(1) end + if checks == 0 then + io.write("no checks ran\n") + os.exit(1) + end io.write("passed ", checks, " checks\n") os.exit(0) end -- cgit 2.12.1