From 9fb59763bce293c2490e0b9f8e97bb1f74ba0910 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Fri, 26 Feb 2010 09:04:11 -0500 Subject: Add --with-test-dir option to configure All 'make check' tests will chdir() into this directory before running the suite. This provides the option of having temporary files generated in a tmpfs or ramdisk --- src/tests/common.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/tests/common.c') diff --git a/src/tests/common.c b/src/tests/common.c index 50dc61b16..4ae1f490b 100644 --- a/src/tests/common.c +++ b/src/tests/common.c @@ -27,9 +27,9 @@ #include "tests/common.h" #include "util/dlinklist.h" -#include "util/util.h" TALLOC_CTX *global_talloc_context = NULL; +#include "util/util.h" struct size_snapshot { struct size_snapshot *prev; @@ -107,3 +107,19 @@ leak_check_teardown(void) } check_leaks(global_talloc_context, 0); } + +void +tests_set_cwd(void) +{ + int ret; + + ret = chdir(TEST_DIR); + if (ret == -1) { + if (strlen(TEST_DIR)) { + fprintf(stderr, + "Could not chdir to [%s].\n" + "Attempting to continue with current dir\n", + TEST_DIR); + } + } +} -- cgit