summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-07-04 00:13:53 +0400
committerArtyom V. Poptsov <poptsov.artyom@gmail.com>2016-07-04 00:13:53 +0400
commitc73a314f55e568a4fe036e2d01abc8bfa4781b31 (patch)
treef9a0df73b966a8703ca3414eb7605d3dbfb2f93e /tests
parenttests/popen.scm: Update copyright dates (diff)
downloadguile-ssh-c73a314f55e568a4fe036e2d01abc8bfa4781b31.tar.gz
tests/common.scm (test-begin-with-log): New procedure
* tests/common.scm (test-begin-with-log): New procedure. * tests/client-server.scm, tests/common.scm, tests/dist.scm, tests/key.scm, tests/popen.scm, tests/server-client.scm, tests/server.scm, tests/session.scm, tests/tunnel.scm: Use it.
Diffstat (limited to 'tests')
-rw-r--r--tests/client-server.scm17
-rw-r--r--tests/common.scm5
-rw-r--r--tests/dist.scm17
-rw-r--r--tests/key.scm11
-rw-r--r--tests/popen.scm7
-rw-r--r--tests/server-client.scm18
-rw-r--r--tests/server.scm7
-rw-r--r--tests/session.scm7
-rw-r--r--tests/tunnel.scm7
9 files changed, 28 insertions, 68 deletions
diff --git a/tests/client-server.scm b/tests/client-server.scm
index 84b18e3..4b6ac06 100644
--- a/tests/client-server.scm
+++ b/tests/client-server.scm
@@ -17,6 +17,8 @@
;; You should have received a copy of the GNU General Public License
;; along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
+(add-to-load-path (getenv "abs_top_srcdir"))
+
(use-modules (srfi srfi-64)
(srfi srfi-26)
(ice-9 threads)
@@ -31,9 +33,10 @@
(ssh channel)
(ssh log)
(ssh tunnel)
- (srfi srfi-4))
+ (srfi srfi-4)
+ (tests common))
-(test-begin "client-server")
+(test-begin-with-log "client-server")
;;; Global symbols
@@ -43,16 +46,6 @@
(define log (test-runner-aux-value (test-runner-current)))
(define *server-thread* #f)
-;;; Load helper procedures
-
-(add-to-load-path (getenv "abs_top_srcdir"))
-(use-modules (tests common))
-
-
-;;; Logging
-
-(setup-test-suite-logging! "client-server")
-
;;; Helper procedures and macros
diff --git a/tests/common.scm b/tests/common.scm
index d73a989..705c81f 100644
--- a/tests/common.scm
+++ b/tests/common.scm
@@ -40,6 +40,7 @@
;; Procedures
get-unused-port
+ test-begin-with-log
test-assert-with-log
test-error-with-log
test-error-with-log/=
@@ -467,4 +468,8 @@ printer."
(setup-libssh-logging! libssh-log-file)
(setup-error-logging! errors-log-file)))
+(define (test-begin-with-log test-name)
+ (test-begin test-name)
+ (setup-test-suite-logging! test-name))
+
;;; common.scm ends here
diff --git a/tests/dist.scm b/tests/dist.scm
index b539ce5..2249757 100644
--- a/tests/dist.scm
+++ b/tests/dist.scm
@@ -17,6 +17,8 @@
;; You should have received a copy of the GNU General Public License
;; along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
+(add-to-load-path (getenv "abs_top_srcdir"))
+
(use-modules (srfi srfi-64)
(ice-9 receive)
(ice-9 rdelim)
@@ -28,19 +30,10 @@
(ssh log)
(ssh dist)
(ssh dist job)
- (ssh dist node))
-
-(test-begin "dist")
-
-;;; Load helper procedures
-
-(add-to-load-path (getenv "abs_top_srcdir"))
-(use-modules (tests common))
-
+ (ssh dist node)
+ (tests common))
-;;; Logging
-
-(setup-test-suite-logging! "dist")
+(test-begin-with-log "dist")
;;;
diff --git a/tests/key.scm b/tests/key.scm
index a8b024a..cfbed1a 100644
--- a/tests/key.scm
+++ b/tests/key.scm
@@ -17,15 +17,12 @@
;; You should have received a copy of the GNU General Public License
;; along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
+(add-to-load-path (getenv "abs_top_srcdir"))
+
(use-modules (srfi srfi-64)
(ssh key)
- (ssh version))
-
-
-;;; Load helper procedures
-
-(add-to-load-path (getenv "abs_top_srcdir"))
-(use-modules (tests common))
+ (ssh version)
+ (tests common))
;;;
diff --git a/tests/popen.scm b/tests/popen.scm
index a1d2eb9..e681b04 100644
--- a/tests/popen.scm
+++ b/tests/popen.scm
@@ -27,12 +27,7 @@
(ssh auth)
(ssh popen))
-(test-begin "popen")
-
-
-;;; Logging
-
-(setup-test-suite-logging! "popen")
+(test-begin-with-log "popen")
;;; Helper procedures.
diff --git a/tests/server-client.scm b/tests/server-client.scm
index 583d087..ea7929d 100644
--- a/tests/server-client.scm
+++ b/tests/server-client.scm
@@ -17,26 +17,18 @@
;; You should have received a copy of the GNU General Public License
;; along with Guile-SSH. If not, see <http://www.gnu.org/licenses/>.
+(add-to-load-path (getenv "abs_top_srcdir"))
+
(use-modules (srfi srfi-64)
(ice-9 threads)
(ssh server)
(ssh session)
(ssh auth)
(ssh message)
- (ssh log))
-
-(test-begin "server-client")
-
-
-;;; Load helper procedures
-
-(add-to-load-path (getenv "abs_top_srcdir"))
-(use-modules (tests common))
-
-
-;;; Logging
+ (ssh log)
+ (tests common))
-(setup-test-suite-logging! "server-client")
+(test-begin-with-log "server-client")
;;; Helper procedures and macros
diff --git a/tests/server.scm b/tests/server.scm
index 17bf25b..7a37a96 100644
--- a/tests/server.scm
+++ b/tests/server.scm
@@ -28,12 +28,7 @@
(define %libssh-minor-version
(string->number (cadr (string-split (get-libssh-version) #\.))))
-(test-begin "server")
-
-
-;;; Logging
-
-(setup-test-suite-logging! "server")
+(test-begin-with-log "server")
;;;
diff --git a/tests/session.scm b/tests/session.scm
index 7b4464a..cada199 100644
--- a/tests/session.scm
+++ b/tests/session.scm
@@ -24,12 +24,7 @@
;; Helper procedures
(tests common))
-(test-begin "session")
-
-
-;;; Logging
-
-(setup-test-suite-logging! "session")
+(test-begin-with-log "session")
;;;
diff --git a/tests/tunnel.scm b/tests/tunnel.scm
index 79c618c..7f06da3 100644
--- a/tests/tunnel.scm
+++ b/tests/tunnel.scm
@@ -33,12 +33,7 @@
(ssh server)
(ssh tunnel))
-(test-begin "tunnel")
-
-
-;;; Logging
-
-(setup-test-suite-logging! "tunnel")
+(test-begin-with-log "tunnel")
;;;