diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-04-20 02:25:04 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-04-20 02:25:04 -0700 |
commit | 47d5feb3175a8cd1dfb515c0f552eb50d2edad47 (patch) | |
tree | bc8b333fdb5fb31c9ba9ed606c20bb85f438e9ba /tests | |
parent | e57078521f985202ba261acdff9a87044dd49572 (diff) | |
download | txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.tar.gz txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.tar.bz2 txr-47d5feb3175a8cd1dfb515c0f552eb50d2edad47.zip |
openbsd: fix tests.
* tests/014/socket-basic.tl (%iters%): Also reduce to 2000 on
OpenBSD, to avoid the default limit on UDP datagram size.
* tests/017/glob-carray.tl: Use the BSD-style struct glob-t
on OpenBSD also.
* tests/017/glob-zarray.tl: Likewise.
* tests/018/chmod.tl (os): New global variable.
(test-sticky): s-isvtx not allowed for non-root user on
OpenBSD, so we falsify this variable.
* tests/common.tl (os-symbol): Add OpenBSD case, producing
:openbsd keyword symbol.
(libc): Let's just use (dlopen nil) for any platform that isn't
Cygwin or Cygnal.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/014/socket-basic.tl | 2 | ||||
-rw-r--r-- | tests/017/glob-carray.tl | 2 | ||||
-rw-r--r-- | tests/017/glob-zarray.tl | 2 | ||||
-rw-r--r-- | tests/018/chmod.tl | 55 | ||||
-rw-r--r-- | tests/common.tl | 5 |
5 files changed, 34 insertions, 32 deletions
diff --git a/tests/014/socket-basic.tl b/tests/014/socket-basic.tl index bbdab7f9..1b4464fb 100644 --- a/tests/014/socket-basic.tl +++ b/tests/014/socket-basic.tl @@ -3,7 +3,7 @@ (defvar socktype) -(defvar %iters% (if (eql :macos (os-symbol)) 2000 5000)) +(defvar %iters% (if (meql (os-symbol) :macos :openbsd) 2000 5000)) (defun client (addr) (with-stream (cli-sock (open-socket af-inet socktype)) diff --git a/tests/017/glob-carray.tl b/tests/017/glob-carray.tl index 7913701b..3ce52980 100644 --- a/tests/017/glob-carray.tl +++ b/tests/017/glob-carray.tl @@ -12,7 +12,7 @@ (nil int) (pathv (carray str)) (nil (array 4 cptr))))) - ((:cygnal :cygwin :android) + ((:cygnal :cygwin :android :openbsd) (deffi-type glob-t (struct glob-t (pathc size-t) (nil size-t) diff --git a/tests/017/glob-zarray.tl b/tests/017/glob-zarray.tl index e3f6d08b..4b804167 100644 --- a/tests/017/glob-zarray.tl +++ b/tests/017/glob-zarray.tl @@ -12,7 +12,7 @@ (nil int) (pathv (ptr-out (zarray str))) (nil (array 4 cptr))))) - ((:cygnal :cygwin :android) + ((:cygnal :cygwin :android :openbsd) (deffi-type glob-t (struct glob-t (pathc size-t) (nil size-t) diff --git a/tests/018/chmod.tl b/tests/018/chmod.tl index 04b63fe7..cadfb077 100644 --- a/tests/018/chmod.tl +++ b/tests/018/chmod.tl @@ -7,7 +7,9 @@ (with-stream (s (open-file tgt "w"))) (umask #o022) -(defvarl test-sticky (progn +(defvarl os (os-symbol) + +(defvarl test-sticky (unless (eq os :openbsd) (chmod tgt s-isvtx) (let ((st (stat tgt))) (plusp (logand s-isvtx st.mode))))) @@ -33,29 +35,28 @@ (error "failed to set mode with ~s: expected ~s, actual ~s" mode expected (enc-perm m))))))) -(let ((os (os-symbol))) - (cht "------------" "a+strwx" "sgtrwxrwxrwx") - (cht "------------" "+strwx" "sgtrwxr-xr-x") - (cht "------------" "u+s" "s-----------") - (cht "------------" "g+s" "-g----------") - (cht "------------" "+t" "--t---------") - (cht "sgtrwxrwxrwx" "=" "------------") - ;; These tests don't work on Cygwin 3.1.7, Windows 10. - ;; They worked on Cygwin 2.5 on Windows 7. - (unless (eq os :cygwin) - (cht "sgtrwxrwxrwx" "u=" "-gt---rwxrwx") - (cht "sgtrwxrwxrwx" "g=" "s-trwx---rwx") - (cht "sgtrwxrwxrwx" "o=" "sg-rwxrwx---")) - (cht "------------" "u+s,g+s" "sg----------") - (cht "------------" "u+r,g+r,o+r,+t,+s" "sgtr--r--r--") - (cht "------------" "+rwx,g-r+w,o-r+w" "---rwx-wx-wx") - (cht "---------rwx" "u=rwsx" "s--rwx---rwx") - (unless (eq os :cygwin) - (cht "---------rwx" "u=rwsx,g=rwx,go-x" "s--rwxrw-rw-") - (cht "---------rwx" "g=o,g-w+s,u=g,o-x" "-g-r-xr-xrw-")) - (cht "---------rwx" "o=o" "---------rwx") - (cht "-----x------" "a+X" "-----x--x--x") - (cht "-----x------" "=,a+X" "------------") - (cht "-----x------" "a-x+X" "------------") - (cht "------------" "u+x-X" "------------") - (cht "------------" "o+x=o" "-----------x")) +(cht "------------" "a+strwx" "sgtrwxrwxrwx") +(cht "------------" "+strwx" "sgtrwxr-xr-x") +(cht "------------" "u+s" "s-----------") +(cht "------------" "g+s" "-g----------") +(cht "------------" "+t" "--t---------") +(cht "sgtrwxrwxrwx" "=" "------------") +;; These tests don't work on Cygwin 3.1.7, Windows 10. +;; They worked on Cygwin 2.5 on Windows 7. +(unless (eq os :cygwin) + (cht "sgtrwxrwxrwx" "u=" "-gt---rwxrwx") + (cht "sgtrwxrwxrwx" "g=" "s-trwx---rwx") + (cht "sgtrwxrwxrwx" "o=" "sg-rwxrwx---")) +(cht "------------" "u+s,g+s" "sg----------") +(cht "------------" "u+r,g+r,o+r,+t,+s" "sgtr--r--r--") +(cht "------------" "+rwx,g-r+w,o-r+w" "---rwx-wx-wx") +(cht "---------rwx" "u=rwsx" "s--rwx---rwx") +(unless (eq os :cygwin) + (cht "---------rwx" "u=rwsx,g=rwx,go-x" "s--rwxrw-rw-") + (cht "---------rwx" "g=o,g-w+s,u=g,o-x" "-g-r-xr-xrw-")) +(cht "---------rwx" "o=o" "---------rwx") +(cht "-----x------" "a+X" "-----x--x--x") +(cht "-----x------" "=,a+X" "------------") +(cht "-----x------" "a-x+X" "------------") +(cht "------------" "u+x-X" "------------") +(cht "------------" "o+x=o" "-----------x")) diff --git a/tests/common.tl b/tests/common.tl index accbf1f7..157cd7e1 100644 --- a/tests/common.tl +++ b/tests/common.tl @@ -32,13 +32,14 @@ (iff (f^ #/CYGWIN/) (ret :cygwin)) (iff (f^ #/CYGNAL/) (ret :cygnal)) (iff (f^ #/Darwin/) (ret :macos)) + (iff (f^ #/OpenBSD/) (ret :openbsd)) (ret :unknown)) u.sysname]))) (defun libc () (caseql (os-symbol) - ((:linux :solaris :macos :android) (dlopen nil)) - ((:cygwin) (dlopen "cygwin1.dll")))) + ((:cygwin :cygnal) (dlopen "cygwin1.dll")) + (t (dlopen nil)))) (defmacro macro-time-let (:env env bindings . body) (with-gensyms (invoke) |