summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-13 18:52:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-13 18:52:18 -0700
commit7872378ee23adf65c2bed5819a74811ed6e954fc (patch)
tree6505d0bb50f6329fd3472ba45416088ebee8ad72 /tests
parentb0c58add3f8ad3da79c6c536925cc7377d59612b (diff)
downloadtxr-7872378ee23adf65c2bed5819a74811ed6e954fc.tar.gz
txr-7872378ee23adf65c2bed5819a74811ed6e954fc.tar.bz2
txr-7872378ee23adf65c2bed5819a74811ed6e954fc.zip
tests: use internal OS identification method.
* tests/common.tl (osname): Function based on calling shell command removed. (os-symbol): New symbol-returning function based on uname system call. * tests/014/dgram-stream.tl (dgram-test): Use os-symbol function rather than osname.
Diffstat (limited to 'tests')
-rw-r--r--tests/014/dgram-stream.tl2
-rw-r--r--tests/common.tl12
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/014/dgram-stream.tl b/tests/014/dgram-stream.tl
index b2ac1165..5902a84d 100644
--- a/tests/014/dgram-stream.tl
+++ b/tests/014/dgram-stream.tl
@@ -35,7 +35,7 @@
(if (and (fboundp 'open-socket)
(fboundp 'fork))
- (let ((maybe-ipv6 (if (memqual (osname) '("GNU/Linux" "Darwin" "Cygwin"))
+ (let ((maybe-ipv6 (if (memq (os-symbol) '(:linux :macos :cygwin :cygnal))
(list af-inet6))))
(each ((family ^(,af-inet ,*maybe-ipv6)))
(unless (dgram-test)
diff --git a/tests/common.tl b/tests/common.tl
index c0dda285..a61c0ff1 100644
--- a/tests/common.tl
+++ b/tests/common.tl
@@ -23,6 +23,12 @@
(defmacro mtest (. pairs)
^(progn ,*(mapcar (op cons 'test) (tuples 2 pairs))))
-(defun osname ()
- (with-stream (u (open-command "(uname -o || uname) 2> /dev/null"))
- (get-line u)))
+(defun os-symbol ()
+ (let ((u (uname)))
+ [(orf (iff (f^ #/Linux/) (ret :linux))
+ (iff (f^ #/SunOS/) (ret :solaris))
+ (iff (f^ #/CYGWIN/) (ret :cygwin))
+ (iff (f^ #/CYGNAL/) (ret :cygnal))
+ (iff (f^ #/Darwin/) (ret :macos))
+ (ret :unknown))
+ u.sysname]))