mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Have `test-ffi' run all the tests even after a failure.
* test-suite/standalone/test-ffi (failed?): New variable. (test): Set `failed?' to #t upon error and display an error message. Have the exit code depend on FAILED?.
This commit is contained in:
parent
86425e2653
commit
8b8ce935ed
1 changed files with 10 additions and 2 deletions
|
@ -8,13 +8,19 @@ exec guile -q -s "$0" "$@"
|
||||||
(define lib
|
(define lib
|
||||||
(dynamic-link (string-append (getenv "builddir") "/libtest-ffi")))
|
(dynamic-link (string-append (getenv "builddir") "/libtest-ffi")))
|
||||||
|
|
||||||
|
(define failed? #f)
|
||||||
|
|
||||||
(define-syntax test
|
(define-syntax test
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ exp res)
|
((_ exp res)
|
||||||
(let ((expected res)
|
(let ((expected res)
|
||||||
(actual exp))
|
(actual exp))
|
||||||
(if (not (equal? actual expected))
|
(if (not (equal? actual expected))
|
||||||
(error "Bad return from expression" 'exp actual expected))))))
|
(begin
|
||||||
|
(set! failed? #t)
|
||||||
|
(format (current-error-port)
|
||||||
|
"bad return from expression `~a': expected ~A; got ~A~%"
|
||||||
|
'exp expected actual)))))))
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; No args
|
;;; No args
|
||||||
|
@ -194,6 +200,8 @@ exec guile -q -s "$0" "$@"
|
||||||
(str (utf8->string bv)))
|
(str (utf8->string bv)))
|
||||||
(test #t (not (not (string-contains str "file")))))
|
(test #t (not (not (string-contains str "file")))))
|
||||||
|
|
||||||
|
(exit (not failed?))
|
||||||
|
|
||||||
;; Local Variables:
|
;; Local Variables:
|
||||||
;; mode: scheme
|
;; mode: scheme
|
||||||
;; End:
|
;; End:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue