summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-24 20:54:24 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-24 21:04:03 +0100
commit599b2c78cb93def13a2ba6731b089d84b32ce352 (patch)
tree4f4743fbfec08b52849c49ba99eb2cd4c93eb25d
parent24406e81532e4212ff825a23f30aa89708fd3704 (diff)
downloadautomake-599b2c78cb93def13a2ba6731b089d84b32ce352.tar.gz
test-driver.scm: Inline 'main' procedure
Having a main procedure involves passing the '-e main' command-line argument to 'guile' which makes the test driver a bit less easy to use. * contrib/test-driver.scm (main): Delete. Move body to the top-level.
-rw-r--r--contrib/test-driver.scm47
1 files changed, 23 insertions, 24 deletions
diff --git a/contrib/test-driver.scm b/contrib/test-driver.scm
index ce34bc643..c72f10ed0 100644
--- a/contrib/test-driver.scm
+++ b/contrib/test-driver.scm
@@ -1,6 +1,6 @@
;;;; test-driver.scm - Guile test driver for Automake testsuite harness
-(define script-version "2018-03-11.22") ;UTC
+(define script-version "2018-03-24.19") ;UTC
;;; Copyright © 2015-2018 Free Software Foundation, Inc.
;;;
@@ -173,29 +173,28 @@ current output port is supposed to be redirected to a '.log' file."
;;; Entry point.
;;;
-(define (main . args)
- (let* ((opts (getopt-long (command-line) %options))
- (option (cut option-ref opts <> <>)))
- (cond
- ((option 'help #f) (show-help))
- ((option 'version #f) (format #t "test-driver.scm ~A" script-version))
- (else
- (let ((log (open-file (option 'log-file "") "w0"))
- (trs (open-file (option 'trs-file "") "wl"))
- (out (duplicate-port (current-output-port) "wl")))
- (redirect-port log (current-output-port))
- (redirect-port log (current-warning-port))
- (redirect-port log (current-error-port))
- (test-with-runner
- (test-runner-gnu (option 'test-name #f)
- #:color? (option->boolean opts 'color-tests)
- #:brief? (option->boolean opts 'brief)
- #:out-port out #:trs-port trs)
- (load-from-path (option 'test-name #f)))
- (close-port log)
- (close-port trs)
- (close-port out))))
- (exit 0)))
+(let* ((opts (getopt-long (command-line) %options))
+ (option (cut option-ref opts <> <>)))
+ (cond
+ ((option 'help #f) (show-help))
+ ((option 'version #f) (format #t "test-driver.scm ~A" script-version))
+ (else
+ (let ((log (open-file (option 'log-file "") "w0"))
+ (trs (open-file (option 'trs-file "") "wl"))
+ (out (duplicate-port (current-output-port) "wl")))
+ (redirect-port log (current-output-port))
+ (redirect-port log (current-warning-port))
+ (redirect-port log (current-error-port))
+ (test-with-runner
+ (test-runner-gnu (option 'test-name #f)
+ #:color? (option->boolean opts 'color-tests)
+ #:brief? (option->boolean opts 'brief)
+ #:out-port out #:trs-port trs)
+ (load-from-path (option 'test-name #f)))
+ (close-port log)
+ (close-port trs)
+ (close-port out))))
+ (exit 0))
;;; Local Variables:
;;; eval: (add-hook 'before-save-hook 'time-stamp)