summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2012-07-25 09:59:17 +0200
committerJakub Hrozek <jhrozek@redhat.com>2012-07-27 10:51:10 +0200
commit2de495aed26bf75a750a76ca73b9f85d341fe1c5 (patch)
treec9ed8a646e2e1b8eae5f8d7718b2f281e16a910e
parente2f7dcb42ab101122d5a851c685af946eed5ddae (diff)
downloadsssd-2de495aed26bf75a750a76ca73b9f85d341fe1c5.tar.gz
sssd-2de495aed26bf75a750a76ca73b9f85d341fe1c5.tar.bz2
sssd-2de495aed26bf75a750a76ca73b9f85d341fe1c5.zip
tests: allow changing cwd in all tests
-rw-r--r--Makefile.am5
-rw-r--r--src/tests/debug-tests.c3
-rw-r--r--src/tests/resolv-tests.c3
-rw-r--r--src/tests/simple_access-tests.c3
4 files changed, 13 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 15e34720..c992c972 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -859,6 +859,7 @@ endif
resolv_tests_SOURCES = \
src/tests/resolv-tests.c \
+ src/tests/common.c \
$(SSSD_RESOLV_TESTS_OBJ)
resolv_tests_CFLAGS = \
$(AM_CFLAGS) \
@@ -946,6 +947,7 @@ ad_ldap_opt_tests_LDADD = \
simple_access_tests_SOURCES = \
src/tests/simple_access-tests.c \
+ src/tests/common.c \
src/providers/simple/simple_access.c
simple_access_tests_CFLAGS = \
$(AM_CFLAGS) \
@@ -967,7 +969,8 @@ util_tests_LDADD = \
libsss_test_common.la
debug_tests_SOURCES = \
- src/tests/debug-tests.c
+ src/tests/debug-tests.c \
+ src/tests/common.c
debug_tests_CFLAGS = \
$(AM_CFLAGS) \
$(CHECK_CFLAGS)
diff --git a/src/tests/debug-tests.c b/src/tests/debug-tests.c
index 40dd2e98..a751d836 100644
--- a/src/tests/debug-tests.c
+++ b/src/tests/debug-tests.c
@@ -28,6 +28,7 @@
#include <errno.h>
#include <string.h>
#include "util/util.h"
+#include "tests/common.h"
#define DEBUG_TEST_ERROR -1
#define DEBUG_TEST_NOK 1
@@ -1022,6 +1023,8 @@ int main(int argc, const char *argv[])
{
int number_failed;
+ tests_set_cwd();
+
Suite *s = debug_suite();
SRunner *sr = srunner_create(s);
diff --git a/src/tests/resolv-tests.c b/src/tests/resolv-tests.c
index b56dc9e8..ad89aaf6 100644
--- a/src/tests/resolv-tests.c
+++ b/src/tests/resolv-tests.c
@@ -33,6 +33,7 @@
#include "tests/common.h"
#include "util/util.h"
+#include "tests/common.h"
/* Interface under test */
#include "resolv/async_resolv.h"
@@ -862,6 +863,8 @@ int main(int argc, const char *argv[])
"option to run the full suite of tests\n");
}
+ tests_set_cwd();
+
resolv_suite = create_resolv_suite();
sr = srunner_create(resolv_suite);
/* If CK_VERBOSITY is set, use that, otherwise it defaults to CK_NORMAL */
diff --git a/src/tests/simple_access-tests.c b/src/tests/simple_access-tests.c
index 4f041d40..c61814eb 100644
--- a/src/tests/simple_access-tests.c
+++ b/src/tests/simple_access-tests.c
@@ -28,6 +28,7 @@
#include "confdb/confdb.h"
#include "providers/simple/simple_access.h"
+#include "tests/common.h"
const char *ulist_1[] = {"u1", "u2", NULL};
@@ -197,6 +198,8 @@ int main(int argc, const char *argv[])
CONVERT_AND_SET_DEBUG_LEVEL(debug_level);
+ tests_set_cwd();
+
Suite *s = access_simple_suite();
SRunner *sr = srunner_create(s);
srunner_run_all(sr, CK_ENV);