mirror of https://codeberg.org/glenneth/stash.git
29 lines
823 B
Scheme
Executable File
29 lines
823 B
Scheme
Executable File
#!/usr/bin/env guile
|
|
!#
|
|
|
|
(use-modules (srfi srfi-64) ; testing framework
|
|
(srfi srfi-1) ; list operations
|
|
(ice-9 ftw) ; file tree walk
|
|
(ice-9 match)) ; pattern matching
|
|
|
|
;; Configure test engine
|
|
(test-runner-current (test-runner-create))
|
|
|
|
;; Helper function to run all test files
|
|
(define (run-test-file filename)
|
|
(format #t "\nRunning tests from ~a:\n" filename)
|
|
(primitive-load filename))
|
|
|
|
;; Find and run all test files
|
|
(define (run-all-tests)
|
|
(let ((test-files (filter (lambda (file)
|
|
(string-suffix? "-test.scm" file))
|
|
(scandir "."))))
|
|
(for-each run-test-file test-files)))
|
|
|
|
;; Run all tests
|
|
(run-all-tests)
|
|
|
|
;; Exit with appropriate status code
|
|
(exit (zero? (test-runner-fail-count (test-runner-current))))
|