diff options
| author | tb <> | 2025-10-07 15:36:30 +0000 |
|---|---|---|
| committer | tb <> | 2025-10-07 15:36:30 +0000 |
| commit | 71f2342f29725a25fb623ca64baee5b85cfa951e (patch) | |
| tree | c097bdfe184d3e49adbe674c81400ecdcba249d0 | |
| parent | 0da76a9548849eb542ab090dc5eace7a2be789cb (diff) | |
| download | openbsd-71f2342f29725a25fb623ca64baee5b85cfa951e.tar.gz openbsd-71f2342f29725a25fb623ca64baee5b85cfa951e.tar.bz2 openbsd-71f2342f29725a25fb623ca64baee5b85cfa951e.zip | |
test framework: allow overriding the "/tmp/" directory
Windows is super picky when it comes to paths, so it needs some special
massaging. Will let us avoid a patch or hack in portable.
| -rw-r--r-- | src/regress/lib/libcrypto/test/test.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/test/test.c b/src/regress/lib/libcrypto/test/test.c index 1188ec34ef..af30e33e5e 100644 --- a/src/regress/lib/libcrypto/test/test.c +++ b/src/regress/lib/libcrypto/test/test.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: test.c,v 1.4 2025/05/31 11:36:48 tb Exp $ */ | 1 | /* $OpenBSD: test.c,v 1.5 2025/10/07 15:36:30 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2025 Joshua Sing <joshua@joshuasing.dev> | 3 | * Copyright (c) 2025 Joshua Sing <joshua@joshuasing.dev> |
| 4 | * | 4 | * |
| @@ -24,6 +24,10 @@ | |||
| 24 | 24 | ||
| 25 | #include "test.h" | 25 | #include "test.h" |
| 26 | 26 | ||
| 27 | #ifndef TEST_TEMP | ||
| 28 | #define TEST_TEMP "/tmp/" | ||
| 29 | #endif | ||
| 30 | |||
| 27 | struct test { | 31 | struct test { |
| 28 | struct test *parent; | 32 | struct test *parent; |
| 29 | char *name; | 33 | char *name; |
| @@ -67,8 +71,8 @@ test_init(void) | |||
| 67 | return t; | 71 | return t; |
| 68 | 72 | ||
| 69 | /* Create a temporary file for logging in non-verbose mode */ | 73 | /* Create a temporary file for logging in non-verbose mode */ |
| 70 | if ((tmp_file = strdup("/tmp/libressl-test.XXXXXXXX")) == NULL) | 74 | if ((asprintf(&tmp_file, "%slibressl-test.XXXXXXXX", TEST_TEMP)) == -1) |
| 71 | err(1, "strdup"); | 75 | err(1, "asprintf"); |
| 72 | if ((out_fd = mkstemp(tmp_file)) == -1) | 76 | if ((out_fd = mkstemp(tmp_file)) == -1) |
| 73 | err(1, "mkstemp"); | 77 | err(1, "mkstemp"); |
| 74 | 78 | ||
