[gnome-keyring] Fix problems building tests using internal functions.



commit 6fdf533b5141398a190ce72f3e3e71140c3de12c
Author: Stef Walter <stef memberwebs com>
Date:   Wed Jan 19 13:12:05 2011 -0600

    Fix problems building tests using internal functions.
    
    Recently the changes to libgck and libgcr --export-symbols-regex
    broke the tests. Export different symbols when tests are enabled
    or not.

 gck/Makefile.am                 |    5 ++++-
 gck/tests/Makefile.am           |    2 +-
 gck/tests/test-gck-crypto.c     |    2 ++
 gck/tests/test-gck-enumerator.c |    1 +
 gck/tests/test-gck-module.c     |    1 +
 gck/tests/test-gck-modules.c    |    1 +
 gck/tests/test-gck-object.c     |    1 +
 gck/tests/test-gck-session.c    |    1 +
 gck/tests/test-gck-slot.c       |    1 +
 gcr/Makefile.am                 |   26 +++++++++++++++-----------
 10 files changed, 28 insertions(+), 13 deletions(-)
---
diff --git a/gck/Makefile.am b/gck/Makefile.am
index 2d7181f..13f83eb 100644
--- a/gck/Makefile.am
+++ b/gck/Makefile.am
@@ -2,9 +2,11 @@
 if WITH_TESTS
 TESTS_DIR = tests
 TESTS_SOURCES = gck-mock.c gck-mock.h gck-test.c gck-test.h
+EXPORT_PATT = '^_?gck_*'
 else
 TESTS_DIR =
 TESTS_SOURCES =
+EXPORT_PATT = '^gck_*'
 endif
 
 SUBDIRS = . \
@@ -47,7 +49,8 @@ libgck_la_SOURCES = \
 
 libgck_la_LDFLAGS = \
 	-version-info $(GCK_LT_RELEASE) \
-	-no-undefined -export-symbols-regex '^gck_*'
+	-no-undefined \
+	-export-symbols-regex $(EXPORT_PATT)
 
 libgck_la_LIBADD = \
 	$(top_builddir)/egg/libegg-hex.la \
diff --git a/gck/tests/Makefile.am b/gck/tests/Makefile.am
index eb3c243..af69779 100644
--- a/gck/tests/Makefile.am
+++ b/gck/tests/Makefile.am
@@ -24,7 +24,7 @@ TESTING_LIBS = \
 include $(top_srcdir)/testing/testing.make
 
 EXTRA_DIST += \
-	gck-test.h
+	test-gck.h
 
 # ------------------------------------------------------------------------
 
diff --git a/gck/tests/test-gck-crypto.c b/gck/tests/test-gck-crypto.c
index 05f9615..abcf159 100644
--- a/gck/tests/test-gck-crypto.c
+++ b/gck/tests/test-gck-crypto.c
@@ -7,6 +7,8 @@
 #include <glib.h>
 
 #include "gck-test.h"
+#include "gck-mock.h"
+#include "test-gck.h"
 
 static GckModule *module = NULL;
 static GckSession *session = NULL;
diff --git a/gck/tests/test-gck-enumerator.c b/gck/tests/test-gck-enumerator.c
index a9148f2..2b63b8e 100644
--- a/gck/tests/test-gck-enumerator.c
+++ b/gck/tests/test-gck-enumerator.c
@@ -3,6 +3,7 @@
 #include <string.h>
 
 #include "test-suite.h"
+#include "test-gck.h"
 #include "gck-test.h"
 #include "gck-private.h"
 
diff --git a/gck/tests/test-gck-module.c b/gck/tests/test-gck-module.c
index da3574b..1c78e8f 100644
--- a/gck/tests/test-gck-module.c
+++ b/gck/tests/test-gck-module.c
@@ -4,6 +4,7 @@
 
 #include "test-suite.h"
 #include "gck-test.h"
+#include "test-gck.h"
 
 static GckModule *module = NULL;
 
diff --git a/gck/tests/test-gck-modules.c b/gck/tests/test-gck-modules.c
index 06dd93e..e4abb04 100644
--- a/gck/tests/test-gck-modules.c
+++ b/gck/tests/test-gck-modules.c
@@ -4,6 +4,7 @@
 
 #include "test-suite.h"
 #include "gck-test.h"
+#include "test-gck.h"
 
 static GList *modules = NULL;
 
diff --git a/gck/tests/test-gck-object.c b/gck/tests/test-gck-object.c
index 7fc4a53..77363fa 100644
--- a/gck/tests/test-gck-object.c
+++ b/gck/tests/test-gck-object.c
@@ -7,6 +7,7 @@
 #include <glib.h>
 
 #include "gck-test.h"
+#include "test-gck.h"
 
 static GckModule *module = NULL;
 static GckSlot *slot = NULL;
diff --git a/gck/tests/test-gck-session.c b/gck/tests/test-gck-session.c
index 1608800..1635fa6 100644
--- a/gck/tests/test-gck-session.c
+++ b/gck/tests/test-gck-session.c
@@ -7,6 +7,7 @@
 #include <glib.h>
 
 #include "gck-test.h"
+#include "test-gck.h"
 
 static GckModule *module = NULL;
 static GckSlot *slot = NULL;
diff --git a/gck/tests/test-gck-slot.c b/gck/tests/test-gck-slot.c
index 0778d74..5d97197 100644
--- a/gck/tests/test-gck-slot.c
+++ b/gck/tests/test-gck-slot.c
@@ -5,6 +5,7 @@
 #include "test-suite.h"
 #include "gck-test.h"
 #include "gck-private.h"
+#include "test-gck.h"
 
 static GckModule *module = NULL;
 static GckSlot *slot = NULL;
diff --git a/gcr/Makefile.am b/gcr/Makefile.am
index 8477714..68aa8c7 100644
--- a/gcr/Makefile.am
+++ b/gcr/Makefile.am
@@ -1,3 +1,15 @@
+
+if WITH_TESTS
+TESTS_DIR = tests
+EXPORT_PATT = '^_?gcr_*'
+else
+TESTS_DIR =
+EXPORT_PATT = '^gcr_*'
+endif
+
+SUBDIRS = . \
+	$(TESTS_DIR)
+
 # ------------------------------------------------------------------
 # UI BUILDER
 # 
@@ -91,7 +103,8 @@ libgcr GCR_VERSION_SUFFIX@_la_CFLAGS = \
 
 libgcr GCR_VERSION_SUFFIX@_la_LDFLAGS = \
 	-version-info $(GCR_LT_RELEASE) \
-	-no-undefined -export-symbols-regex '^gcr_*'
+	-no-undefined \
+	-export-symbols-regex $(EXPORT_PATT)
 
 libgcr GCR_VERSION_SUFFIX@_la_LIBADD = \
 	$(top_builddir)/egg/libegg.la \
@@ -128,13 +141,4 @@ CLEANFILES = \
 	$(pkgconfig_DATA)
 
 DISTCLEANFILES = \
-	$(pkgconfig_DATA)
-
-if WITH_TESTS
-TESTS_DIR = tests
-else
-TESTS_DIR = 
-endif
-
-SUBDIRS = . \
-	$(TESTS_DIR)
+	$(pkgconfig_DATA)
\ No newline at end of file



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