summaryrefslogtreecommitdiffstats
path: root/tests/017
Commit message (Collapse)AuthorAgeFilesLines
* ffi: glob test: struct size on Linux and Cygwin.Kaz Kylheku2017-05-212-22/+40
| | | | | | | | | * 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-212-10/+28
| | | | | | | | | * 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 realpath.Kaz Kylheku2017-05-202-0/+14
| | | | | | | | | | | | | | | | | The realpath function is called using FFI. One approach passes a null pointer, so that the function dynamically allocates. The return value is str-d, causing FFI to take ownership of the pointer, freeing it. The other approach is to pass a pointer to a large null-terminated character array, marked for ownership transfer to the function. FFI allocates it and puts the argument into it, which is just a dummy empty string. The function fills that buffer and returns it. The return is captured as a str-d, so FFI takes ownership back, and frees the buffer. * tests/017/realpath.tl: New function. * tests/017/realpath.expected: Likewise.
* ffi: add two tests based on glob function.Kaz Kylheku2017-05-204-0/+45
| | | | | | | | | | | | | | | | | | | 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.
* tests: first FFI regression test case.Kaz Kylheku2017-05-132-0/+48
* tests/017/qsort.expected: New file. * tests/017/qsort.tl: New file. * tests/common.tl (libc): New function. * Makefile (tst/tests/017/%): Clear TXR_DBG_OPTS so the GC stress test isn't applied to tests in this directory.