New test files: - test-config.scm (15 tests): find-config directory walking, load-config with explicit/missing/auto-discovery paths, merge-configs override semantics, generate-template pretty-print output validity. - test-engine.scm (40 tests): filter-rules-by-config with enable/disable/combined, severity>=? helper, lint-file with --pass surface (no compile errors leak), severity filtering (info excluded at warning level), rule disabling via config. Fix mode tests: trailing-whitespace fix, comment-semicolons fix (single ; → ;;), no-tabs fix (8-space expansion), tab-stop alignment, blank-lines deletion, fix composition (tabs + trailing whitespace on same line), idempotency (second pass changes nothing), multi-pass convergence (3-way conflict: tabs + trailing + comment on same line converges in 2 passes). Compile-error formatting: no raw ~S/~A format specifiers in error messages, module name present in output. Integration: lint-files with %fix mode applies fixes and returns 0 unfixed count.
37 lines
1.1 KiB
Scheme
37 lines
1.1 KiB
Scheme
#!/usr/bin/env -S guile --no-auto-compile -s
|
|
!#
|
|
;;; Test runner for gulie
|
|
|
|
;; Add project root to load path
|
|
(let ((dir (dirname (dirname (current-filename)))))
|
|
(set! %load-path (cons dir %load-path)))
|
|
|
|
(use-modules (srfi srfi-64))
|
|
|
|
;; Configure test runner for CI-friendly output
|
|
(test-runner-current
|
|
(let ((runner (test-runner-simple)))
|
|
(test-runner-on-final! runner
|
|
(lambda (runner)
|
|
(let ((pass (test-runner-pass-count runner))
|
|
(fail (test-runner-fail-count runner))
|
|
(skip (test-runner-skip-count runner)))
|
|
(newline)
|
|
(format #t "Results: ~a passed, ~a failed, ~a skipped~%"
|
|
pass fail skip)
|
|
(when (> fail 0)
|
|
(exit 1)))))
|
|
runner))
|
|
|
|
;; Load and run all test files (paths relative to project root)
|
|
(let ((root (dirname (dirname (current-filename)))))
|
|
(define (load-test name)
|
|
(load (string-append root "/test/" name)))
|
|
(load-test "test-tokenizer.scm")
|
|
(load-test "test-cst.scm")
|
|
(load-test "test-rules.scm")
|
|
(load-test "test-suppression.scm")
|
|
(load-test "test-compiler.scm")
|
|
(load-test "test-config.scm")
|
|
(load-test "test-engine.scm"))
|