summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Lirzin <mthl@gnu.org>2018-03-24 23:42:16 +0100
committerMathieu Lirzin <mthl@gnu.org>2018-03-24 23:42:16 +0100
commit66c69584f58983e3f61635bbb56bfad1516af87b (patch)
tree4e934b719530da96ded05cf6824bc730c868d78b
parent599b2c78cb93def13a2ba6731b089d84b32ce352 (diff)
downloadautomake-66c69584f58983e3f61635bbb56bfad1516af87b.tar.gz
test-driver.scm: Don't guess script name from "--test-name"
'primitive-load' is used instead of 'load-from-path' since the script is given as a relative file name. For unknown reason, using 'load' fails with GNU Mcron test suite when running 'make distcheck'. * contrib/test-driver.scm: Get the actual script name directly from the command line. Handle the case where that argument is missing.
-rw-r--r--contrib/test-driver.scm38
1 files changed, 22 insertions, 16 deletions
diff --git a/contrib/test-driver.scm b/contrib/test-driver.scm
index c72f10ed0..5292c0a0e 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-24.19") ;UTC
+(define script-version "2018-03-24.22") ;UTC
;;; Copyright © 2015-2018 Free Software Foundation, Inc.
;;;
@@ -49,6 +49,7 @@
;;;; Code:
(use-modules (ice-9 getopt-long)
+ (ice-9 match)
(ice-9 pretty-print)
(srfi srfi-26)
(srfi srfi-64))
@@ -179,21 +180,26 @@ current output port is supposed to be redirected to a '.log' file."
((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))))
+ (match (option '() '())
+ (()
+ (display "missing test script argument\n" (current-error-port))
+ (exit 1))
+ ((script . args)
+ (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)
+ (primitive-load script))
+ (close-port log)
+ (close-port trs)
+ (close-port out))))))
(exit 0))
;;; Local Variables: