[gnome-keyring/dbus-api] Cleanup tests, hook into 'make check'.



commit 586c07f068f67581c1a35b4e91b7e3901ecc9996
Author: Stef Walter <stef memberwebs com>
Date:   Mon Jul 13 17:52:57 2009 +0000

    Cleanup tests, hook into 'make check'.
    
    Hook tests into make check. Fix some assumptions in tests
    about the order of setup functions being run.

 Makefile.am                                     |    9 -------
 daemon/keyrings/tests/unit-test-keyring-login.c |   16 ++++++++++---
 tests/Makefile.am                               |   13 -----------
 tests/gtest.make                                |    7 ++++-
 tests/run-tests.sh                              |   27 -----------------------
 5 files changed, 17 insertions(+), 55 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d3c0270..8c4e10a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -56,14 +56,5 @@ dist-hook:
 		echo A git clone is required to generate a ChangeLog >&2; \
 	fi
 
-distcheck-hook: 
-	@echo "RUNNING AUTOMATIC UNIT TESTS ---------------------------"
-	@echo
-	@echo
-	$(MAKE) -C tests run-auto
-	@echo
-	@echo
-	@echo "DONE AUTOMATIC UNIT TESTS ------------------------------"
-
 install-pam:
 	@echo "WARNING: install-pam is no longer used, use the --with-pam-dir configure option instead"
diff --git a/daemon/keyrings/tests/unit-test-keyring-login.c b/daemon/keyrings/tests/unit-test-keyring-login.c
index d81fa50..d6f236c 100644
--- a/daemon/keyrings/tests/unit-test-keyring-login.c
+++ b/daemon/keyrings/tests/unit-test-keyring-login.c
@@ -42,8 +42,6 @@ DEFINE_SETUP(keyrings_login)
 	/* Remove the current login keyring */
 	GkrKeyring *login = gkr_keyrings_get_login ();
 	if (login) {
-		g_printerr ("removing old login keyring: %s\n", 
-                            gkr_location_to_path (login->location));
 		gkr_keyring_remove_from_disk (login);
 		gkr_keyrings_remove (login);
 	}
@@ -94,7 +92,14 @@ DEFINE_TEST(keyrings_login)
 
 DEFINE_TEST(keyrings_login_master)
 {
-	const gchar *master = gkr_keyring_login_master();
+	const gchar *master;
+	gboolean ret;
+	
+	/* Unlock and create a new login keyring */
+	ret = gkr_keyring_login_unlock ("blah");
+	g_assert (ret);
+	
+	master = gkr_keyring_login_master();
 	/* "no master password in login keyring" */
 	g_assert (master != NULL);
 	/* "wrong master password in login keyring" */
@@ -104,7 +109,10 @@ DEFINE_TEST(keyrings_login_master)
 DEFINE_TEST(keyrings_login_secrets)
 {
 	const gchar *password;
-	
+
+	/* Unlock and create a new login keyring */
+	gkr_keyring_login_unlock ("blah");
+
 	/* Save a password away */
 	gkr_keyring_login_attach_secret (GNOME_KEYRING_ITEM_GENERIC_SECRET,
 	                                 "Display Name", "secret", 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0a8d227..6cb7808 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,6 @@ EXTRA_DIST = \
 	ca-example \
 	gtest-helpers.c gtest-helpers.h \
 	prep-gtest.sh \
-	run-tests.sh \
 	gtest.make
 
 INCLUDES=				\
@@ -45,15 +44,3 @@ test_keyring_two_SOURCES = \
 
 test_keyring_two_LDADD = \
 	$(top_builddir)/library/libgnome-keyring.la
-
-
-# ------------------------------------------------------------------------------
-# Run the tests
-
-run: run-auto
-
-run-auto: 
-	sh run-tests.sh $(top_srcdir) run-auto-test
-
-run-prompt: 
-	sh run-tests.sh $(top_srcdir) run-prompt-test
diff --git a/tests/gtest.make b/tests/gtest.make
index 4d887ee..01d293f 100644
--- a/tests/gtest.make
+++ b/tests/gtest.make
@@ -56,7 +56,10 @@ run_prompt_test_CFLAGS = \
 # Run the tests
 
 test-auto: $(noinst_PROGRAMS)
-	gtester -k -m=slow ./run-auto-test
+	gtester --verbose -k -m=slow ./run-auto-test
 
 test-prompt: $(noinst_PROGRAMS)
-	gtester -k -m=slow ./run-prompt-test
+	gtester --verbose -k -m=slow ./run-prompt-test
+
+check-am: $(noinst_PROGRAMS)
+	gtester -m=slow ./run-auto-test



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]