build: test-driver.scm: Allow running as a standalone script.

* build-aux/test-driver.scm: Add an exec-based shebang and set the script
executable bit.
(main): Insert a newline after the version string is printed with --version.
This commit is contained in:
Maxim Cournoyer 2021-01-16 22:30:33 -05:00
parent 93a628c4e4
commit 26a66d0fea
No known key found for this signature in database
GPG key ID: 1260E46482E63562

5
build-aux/test-driver.scm Normal file → Executable file
View file

@ -1,3 +1,6 @@
#!/bin/sh
exec guile --no-auto-compile -e main -s "$0" "$@"
!#
;;;; test-driver.scm - Guile test driver for Automake testsuite harness ;;;; test-driver.scm - Guile test driver for Automake testsuite harness
(define script-version "2021-01-26.20") ;UTC (define script-version "2021-01-26.20") ;UTC
@ -211,7 +214,7 @@ (define (main . args)
(option (cut option-ref opts <> <>))) (option (cut option-ref opts <> <>)))
(cond (cond
((option 'help #f) (show-help)) ((option 'help #f) (show-help))
((option 'version #f) (format #t "test-driver.scm ~A" script-version)) ((option 'version #f) (format #t "test-driver.scm ~A~%" script-version))
(else (else
(let* ((log (and=> (option 'log-file #f) (cut open-file <> "w0"))) (let* ((log (and=> (option 'log-file #f) (cut open-file <> "w0")))
(trs (and=> (option 'trs-file #f) (cut open-file <> "wl"))) (trs (and=> (option 'trs-file #f) (cut open-file <> "wl")))