Skip to content

Commit

Permalink
tests: Fix test suite for Guile 3.0.5.
Browse files Browse the repository at this point in the history
The test-runner object is now reset to #f when calling the 'test-end'
procedure.  See the commit de5d1a7f99b8e952b115237ebc29633062f99bb9 in
Guile (srfi-64: Reset test-runner-current if done) which introduced this
change.

* tests/client-server.scm (exit-status): New variable.  Use it when calling
exit.
* tests/dist.scm: Likewise.
* tests/key.scm: Likewise.
* tests/log.scm: Likewise.
* tests/popen.scm: Likewise.
* tests/server-client.scm: Likewise.
* tests/server.scm: Likewise.
* tests/session.scm: Likewise.
* tests/shell.scm: Likewise.
* tests/sssh-ssshd.scm: Likewise.
* tests/tunnel.scm: Likewise.
  • Loading branch information
Apteryks committed Feb 4, 2021
1 parent 9590376 commit f7942cd
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 11 deletions.
4 changes: 3 additions & 1 deletion tests/client-server.scm
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,10 @@

;;;

(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "client-server")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; client-server.scm ends here.
4 changes: 3 additions & 1 deletion tests/dist.scm
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ $4 = #<session #<undefined>@#<undefined>:22 (disconnected) 453fff>"
;;;


(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "dist")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; dist.scm ends here.
3 changes: 2 additions & 1 deletion tests/key.scm
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@
(eq? (get-key-type key) 'ecdsa-p256)))))))

;;;
(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "key")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; key.scm ends here.
5 changes: 4 additions & 1 deletion tests/log.scm
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@
(get-log-verbosity))


(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "log")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))


;;; log.scm ends here
4 changes: 3 additions & 1 deletion tests/popen.scm
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,10 @@
(format-log/scm 'nolog "open-remote-output-pipe" "channel: ~A" channel)
(output-only? channel)))))))

(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "popen")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; popen.scm ends here.
4 changes: 3 additions & 1 deletion tests/server-client.scm
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,10 @@
(equal? x session))))))


(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "server-client")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; server-client.scm ends here.
4 changes: 3 additions & 1 deletion tests/server.scm
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,11 @@
(server-listen server)
#t))

(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "server")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; server.scm ends here.

4 changes: 3 additions & 1 deletion tests/session.scm
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@
(let ((session (%make-session)))
(not (connected? session))))

(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "session")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; session.scm ends here.
3 changes: 2 additions & 1 deletion tests/shell.scm
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,10 @@


;;;
(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "shell")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; shell.scm ends here.
4 changes: 3 additions & 1 deletion tests/sssh-ssshd.scm
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@
result)))


(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "sssh-ssshd")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; sssh-ssshd.scm ends here.
4 changes: 3 additions & 1 deletion tests/tunnel.scm
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,10 @@
(= pnum portnum)))
(eq? (channel-cancel-forward session "localhost" portnum) 'ok))))))))

(define exit-status (test-runner-fail-count (test-runner-current)))

(test-end "tunnel")

(exit (= (test-runner-fail-count (test-runner-current)) 0))
(exit (= 0 exit-status))

;;; tunnel.scm ends here.

0 comments on commit f7942cd

Please sign in to comment.