[SSSD] [PATCH 1/1] tests: Don't assume absolute test dir in test_io.c
Lukas Slebodnik
lslebodn at redhat.com
Tue Apr 15 18:42:38 UTC 2014
On (15/04/14 20:00), Nikolai Kondrashov wrote:
>Hi everyone,
>
>This fixes test-io execution with relative test dir.
>
>Sincerely,
>Nick
>From 76b7d1ff6b1a4117a5e8917b29d8b2b916d1e439 Mon Sep 17 00:00:00 2001
>From: Nikolai Kondrashov <Nikolai.Kondrashov at redhat.com>
>Date: Tue, 15 Apr 2014 19:08:34 +0300
>Subject: [PATCH 1/1] tests: Don't assume absolute test dir in test_io.c
>
>Do not assume TEST_DIR path is absolute in test_io.c, assume it is
>the current directory.
>
>This fixes test-io execution with relative test dir path configured
>with --with-test-dir.
>---
> src/tests/cmocka/test_io.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/src/tests/cmocka/test_io.c b/src/tests/cmocka/test_io.c
>index 266f2ce..453e8f7 100644
>--- a/src/tests/cmocka/test_io.c
>+++ b/src/tests/cmocka/test_io.c
>@@ -40,7 +40,7 @@
> #include "util/util.h"
> #include "tests/common.h"
>
>-#define FILE_PATH TEST_DIR"/test_io.XXXXXX"
>+#define FILE_PATH "test_io.XXXXXX"
> #define NON_EX_PATH "non-existent-path"
>
> /* Creates a unique temporary file inside TEST_DIR and returns its path*/
>@@ -63,7 +63,7 @@ static char *get_filepath(char path[])
>
> void setup_dirp(void **state)
> {
>- DIR *dirp = opendir(TEST_DIR);
>+ DIR *dirp = opendir(".");
> if (dirp == NULL) {
> int err = errno;
> fprintf(stderr, "Could not open directory:'%s' [%s]\n",
>--
>1.9.1
>
This patch is useless.
The default value of TESTDIR is "."
AC_DEFUN([WITH_TEST_DIR],
[ AC_ARG_WITH([test-dir],
[AC_HELP_STRING([--with-test-dir=PATH],
[Directory used for make check temporary files [$builddir]]
)
],
[TEST_DIR=$withval],
[TEST_DIR="."]
)
AC_SUBST(TEST_DIR)
AC_DEFINE_UNQUOTED(TEST_DIR, "$TEST_DIR", [Directory used for 'make check' temporary files])
])
LS
More information about the sssd-devel
mailing list