diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-03-10 06:49:57 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-03-10 06:49:57 -0800 |
commit | a6551d3c4b832ef4b724e6039c615dfd56d76b7e (patch) | |
tree | 34a04280205ef50086e6e69c6f61772e9ddb3dd6 /tests | |
parent | 8bc6ba624272e9df414358195025cd696c491ad9 (diff) | |
download | txr-a6551d3c4b832ef4b724e6039c615dfd56d76b7e.tar.gz txr-a6551d3c4b832ef4b724e6039c615dfd56d76b7e.tar.bz2 txr-a6551d3c4b832ef4b724e6039c615dfd56d76b7e.zip |
Run IPv6 tests only on some operating systems.
* tests/014/dgram-stream.tl (test): Renamed to
dgram-test since now this includes common.tl which
has a macro called test.
Only include af-inet6 in the family list if
the OS is GNU/Linux, Darwin or Cygwin.
* tests/common.tl (osname): New function.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/014/dgram-stream.tl | 11 | ||||
-rw-r--r-- | tests/common.tl | 4 |
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/014/dgram-stream.tl b/tests/014/dgram-stream.tl index feb272ba..b2ac1165 100644 --- a/tests/014/dgram-stream.tl +++ b/tests/014/dgram-stream.tl @@ -1,3 +1,4 @@ +(load "../common.tl") (load "../sock-common.tl") (defvar family) @@ -20,7 +21,7 @@ (print nil cli-sock) (flush-stream cli-sock))) -(defun test () +(defun dgram-test () (let* ((svc-sock (open-socket family sock-dgram)) (svc-addr (bindfree svc-sock 1025 65535)) (server-pid (fork))) @@ -34,6 +35,8 @@ (if (and (fboundp 'open-socket) (fboundp 'fork)) - (each ((family (list af-inet af-inet6))) - (unless (test) - (error "test failed")))) + (let ((maybe-ipv6 (if (memqual (osname) '("GNU/Linux" "Darwin" "Cygwin")) + (list af-inet6)))) + (each ((family ^(,af-inet ,*maybe-ipv6))) + (unless (dgram-test) + (error "test failed"))))) diff --git a/tests/common.tl b/tests/common.tl index 301a5402..ea2be1d5 100644 --- a/tests/common.tl +++ b/tests/common.tl @@ -19,3 +19,7 @@ (defmacro stest (expr expected) ^(vtest ,^(tostring ,expr) ,expected)) + +(defun osname () + (with-stream (u (open-command "(uname -o || uname) 2> /dev/null")) + (get-line u))) |