Skip to content

Commit b9a0a46

Browse files
Copilotvgoehler
andauthored
tests: track 'no tests found' as skipped, report per-framework in summary
- Add bats_skipped/cram_skipped flags; set when no .bats/.t files exist - Summary distinguishes SKIPPED (no files) from FAILED and PASSED - Per-framework failure reporting was already in place since b392c24 Agent-Logs-Url: https://github.com/TUBAF-IfI-LiaScript/TUBAF-IfI-LiaScript.github.io/sessions/d435cc2c-bb3a-4df9-8313-636975974590 Co-authored-by: vgoehler <1705385+vgoehler@users.noreply.github.com>
1 parent b392c24 commit b9a0a46

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

tests/run_tests.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ set -euo pipefail
1515
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
1616
TESTS_DIR="$REPO_ROOT/tests"
1717

18-
# Per-framework pass/fail tracking (0 = passed, 1 = failed)
18+
# Per-framework pass/fail/skip tracking (0 = passed/not-skipped, 1 = failed/skipped)
1919
bats_failed=0
20+
bats_skipped=0
2021
cram_failed=0
22+
cram_skipped=0
2123
remake_failed=0
2224

2325
# ---------------------------------------------------------------------------
@@ -61,7 +63,8 @@ echo " ✅ bats, cram, remake all found"
6163
section "bats (shell script unit tests)"
6264
bats_files=("$TESTS_DIR"/bats/*.bats)
6365
if [ ! -e "${bats_files[0]}" ]; then
64-
echo " ⚠️ No .bats files found in tests/bats/ – nothing to run"
66+
echo " ⚠️ No .bats files found in tests/bats/ – skipping bats suite"
67+
bats_skipped=1
6568
else
6669
for bats_file in "${bats_files[@]}"; do
6770
echo ""
@@ -78,7 +81,8 @@ fi
7881
section "cram (CLI integration tests)"
7982
cram_files=("$TESTS_DIR"/cram/*.t)
8083
if [ ! -e "${cram_files[0]}" ]; then
81-
echo " ⚠️ No .t files found in tests/cram/ – nothing to run"
84+
echo " ⚠️ No .t files found in tests/cram/ – skipping cram suite"
85+
cram_skipped=1
8286
else
8387
export REPO_ROOT
8488
if cram --shell=bash "${cram_files[@]}"; then
@@ -105,12 +109,15 @@ overall_failed=$(( bats_failed + cram_failed + remake_failed ))
105109

106110
echo ""
107111
echo "╔══════════════════════════════════════╗"
108-
if [ "$overall_failed" -eq 0 ]; then
112+
if [ "$overall_failed" -eq 0 ] && [ "$bats_skipped" -eq 0 ] && [ "$cram_skipped" -eq 0 ]; then
109113
echo "║ ✅ All test suites passed ║"
110114
else
111115
[ "$bats_failed" -eq 1 ] && echo "║ ❌ bats suite FAILED ║"
112116
[ "$cram_failed" -eq 1 ] && echo "║ ❌ cram suite FAILED ║"
113117
[ "$remake_failed" -eq 1 ] && echo "║ ❌ remake suite FAILED ║"
118+
[ "$bats_skipped" -eq 1 ] && echo "║ ⚠️ bats suite SKIPPED (no files) ║"
119+
[ "$cram_skipped" -eq 1 ] && echo "║ ⚠️ cram suite SKIPPED (no files) ║"
120+
[ "$overall_failed" -eq 0 ] && echo "║ ✅ No failures (some suites skipped)║"
114121
fi
115122
echo "╚══════════════════════════════════════╝"
116123
exit "$overall_failed"

0 commit comments

Comments
 (0)