summaryrefslogtreecommitdiffstats
path: root/tests/017/glob-carray.tl
Commit message (Collapse)AuthorAgeFilesLines
* openbsd: more tests fixes.Kaz Kylheku2024-01-051-1/+1
| | | | | | | | | | | | | * tests/014/socket-basic.tl: Test for :openbsd also were we test for :bsd. * tests/014/glob-carray.tl: Likewise. * tests/017/glob-zarray.tl: Likewise. * tests/017/mmap.tl: Likewise. * tests/018/chmod.tl: Likewise.
* tests: support BSD flavors loosely, not just OpenBSD.Kaz Kylheku2021-08-131-1/+1
| | | | | | | | | | | | * tests/common.tl (os-symbol): Look for the substring BSD in the system name, and map to symbol :bsd. Do not produce the :openbsd symbol. * tests/014/socket-basic.tl: Refer to :bsd, not :openbsd. * tests/017/glob-carray.tl: Likewise. * tests/018/chmod.tl: Likewise.
* openbsd: fix tests.Kaz Kylheku2021-04-201-1/+1
| | | | | | | | | | | | | | | | | | | * 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.
* android: fix socket module, failing tests.Kaz Kylheku2020-12-231-1/+1
| | | | | | | | | | | | | * socket.c: Add missing #include <netinet/in.h>. * tests/017/glob-carray.tl, tests/017/glob-zarray.tl: Use same definition for struct glob as Cygwin. Both are of BSD origin. * tests/017/realpath.tl: Do not test on Android. * tests/common.tl (os-symbol): Detect Android and return :android. (libc): Handle :android.
* tests: broken glob test cases crash under musl.Kaz Kylheku2020-01-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | Among several issues, the main one is that these test cases use the str-d FFI type for strings. This type means that TXR will take ownership of the memory; it creates the Lisp strings for the Lisp array, and then assuming that it has owership of the C strings, it will free them. On musl, this causes an instant crash, probably because the strings might not be individually coming from malloc. The only documented interface for freing glob resources is globfree; programs cannot assume that the strings can be freed. * tests/017/glob-carray.expected: Updated. * tests/017/glob-carray.tl (glob-t): Add missing flags member of type int. Change the array element string type from str-d to str. * tests/017/glob-zarray.tl: Likewise, and also add a comment to explain why we are not calling globfree in this test case.
* ffi: glob test: struct size on Linux and Cygwin.Kaz Kylheku2017-05-211-11/+20
| | | | | | | | | * tests/017/glob-carray.tl (glob-t): Restructure to case statement. Add padding to struct based on looking at the glibc definition. Add FFI definition based on Cygwin header. * tests/017/glob-zarray.tl (glob-t): Likewise.
* ffi: port glob tests to Darwin.Kaz Kylheku2017-05-211-5/+14
| | | | | | | | | * tests/017/glob-carray.tl (glob-t): Initialize reserve member to 0. Since it doesn't exist on Darwin, it will stay nil, and change the the test output. A Darwin variant of the corresponding FFI type is provided. * tests/017/glob-zarray.tl (glob-t): Likewise.
* ffi: add two tests based on glob function.Kaz Kylheku2017-05-201-0/+21
One approach captures the paths as a carray of strings, and explicitly frees it with globfree. The other approach uses a zarray, taking advantage of null termination. globfree is elided because TXR FFI does the freeing; the types used declare to it that it is taking ownership of a dynamically allocated vector of dynamically allocated strings, and so it performs the equivalent of globfree. * tests/017/glob-carray.expected: New file. * tests/017/glob-carray.tl: Likewise. * tests/017/glob-zarray.expected: Likewise. * tests/017/glob-zarray.tl: Likewise.