From 71f2342f29725a25fb623ca64baee5b85cfa951e Mon Sep 17 00:00:00 2001 From: tb <> Date: Tue, 7 Oct 2025 15:36:30 +0000 Subject: 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. --- src/regress/lib/libcrypto/test/test.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: test.c,v 1.4 2025/05/31 11:36:48 tb Exp $ */ +/* $OpenBSD: test.c,v 1.5 2025/10/07 15:36:30 tb Exp $ */ /* * Copyright (c) 2025 Joshua Sing * @@ -24,6 +24,10 @@ #include "test.h" +#ifndef TEST_TEMP +#define TEST_TEMP "/tmp/" +#endif + struct test { struct test *parent; char *name; @@ -67,8 +71,8 @@ test_init(void) return t; /* Create a temporary file for logging in non-verbose mode */ - if ((tmp_file = strdup("/tmp/libressl-test.XXXXXXXX")) == NULL) - err(1, "strdup"); + if ((asprintf(&tmp_file, "%slibressl-test.XXXXXXXX", TEST_TEMP)) == -1) + err(1, "asprintf"); if ((out_fd = mkstemp(tmp_file)) == -1) err(1, "mkstemp"); -- cgit v1.2.3-55-g6feb