Phase 0: strip JetBrains template, register Jai language and file type

- delete demo tool window + message bundle, rewrite plugin.xml metadata
- add JaiLanguage, JaiFileType, file icon, JaiTokenTypes (from the compiler's
  own lexer: modules/Jai_Lexer/module.jai)
- add ./jaitest: runs tests and reports the JUnit XML, not just the exit code
- ignore .kotlin
This commit is contained in:
hgranthorner
2026-08-04 10:19:11 -04:00
parent cb5a1d9555
commit 711334885b
11 changed files with 510 additions and 81 deletions

46
jaitest Executable file
View File

@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Run the test suite and report the JUnit XML, not just the exit code.
#
# A green `test` task does not prove tests ran (see AGENTS.md), so this always
# prints tests/failures/errors per suite and dumps failure messages.
#
# Usage: ./jaitest [gradle args...] e.g. ./jaitest --tests '*Lexer*'
set -uo pipefail
cd "$(dirname "$0")" || exit 1
rm -rf build/test-results/test
./jaigradle test "$@" 2>&1 | grep -vE '^\[[0-9.]+s\]\[warning\]\[cds\]'
gradle_status=${PIPESTATUS[0]}
echo
echo "=== JUnit XML ==="
shopt -s nullglob
xml=(build/test-results/test/*.xml)
if [ ${#xml[@]} -eq 0 ]; then
echo "NO TEST XML PRODUCED — tests did not run."
exit 1
fi
total=0
bad=0
for f in "${xml[@]}"; do
line=$(sed -n '2p' "$f")
name=$(sed -nE 's/^<testsuite name="([^"]*)".*/\1/p' <<<"$line")
t=$(sed -nE 's/.*tests="([0-9]*)".*/\1/p' <<<"$line")
fa=$(sed -nE 's/.*failures="([0-9]*)".*/\1/p' <<<"$line")
er=$(sed -nE 's/.*errors="([0-9]*)".*/\1/p' <<<"$line")
sk=$(sed -nE 's/.*skipped="([0-9]*)".*/\1/p' <<<"$line")
printf '%-60s tests=%s skipped=%s failures=%s errors=%s\n' "$name" "$t" "$sk" "$fa" "$er"
total=$((total + t))
bad=$((bad + fa + er))
if [ "$fa" != "0" ] || [ "$er" != "0" ]; then
grep -E '<(failure|error) ' "$f" | head -40
fi
done
echo "--- total tests=$total failures+errors=$bad gradle_exit=$gradle_status"
if [ "$total" -eq 0 ] || [ "$bad" -ne 0 ] || [ "$gradle_status" -ne 0 ]; then
exit 1
fi
echo "OK"