test: use relative paths for pipes and Unix sockets

This fixes the test suite in environments where `/tmp` is not writable
or does not allow the use of Unix sockets, and matches the use of
relative paths elsewhere in the tests.
This commit is contained in:
Emily 2025-07-29 18:04:17 +01:00
parent 33b192c845
commit c4d7c6711f
3 changed files with 5 additions and 9 deletions

View File

@ -6,7 +6,7 @@
#ifdef _WIN32
#define PIPENAME "\\\\?\\pipe\\echo.sock"
#else
#define PIPENAME "/tmp/echo.sock"
#define PIPENAME "echo.sock"
#endif
uv_loop_t *loop;

View File

@ -53,14 +53,10 @@
# define TEST_PIPENAME "\\\\.\\pipe\\uv-test"
# define TEST_PIPENAME_2 "\\\\.\\pipe\\uv-test2"
# define TEST_PIPENAME_3 "\\\\.\\pipe\\uv-test3"
#elif __ANDROID__
# define TEST_PIPENAME "/data/local/tmp/uv-test-sock"
# define TEST_PIPENAME_2 "/data/local/tmp/uv-test-sock2"
# define TEST_PIPENAME_3 "/data/local/tmp/uv-test-sock3"
#else
# define TEST_PIPENAME "/tmp/uv-test-sock"
# define TEST_PIPENAME_2 "/tmp/uv-test-sock2"
# define TEST_PIPENAME_3 "/tmp/uv-test-sock3"
# define TEST_PIPENAME "uv-test-sock"
# define TEST_PIPENAME_2 "uv-test-sock2"
# define TEST_PIPENAME_3 "uv-test-sock3"
#endif
#ifdef _WIN32

View File

@ -633,7 +633,7 @@ TEST_IMPL(poll_unidirectional) {
* In addition to regular files, we also disallow FIFOs on Darwin.
*/
#ifdef __APPLE__
#define TEST_POLL_FIFO_PATH "/tmp/uv-test-poll-fifo"
#define TEST_POLL_FIFO_PATH "uv-test-poll-fifo"
#endif
TEST_IMPL(poll_bad_fdtype) {
#if !defined(__sun) && \