[gtksourceview] build: "core" helper library for unit tests
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview] build: "core" helper library for unit tests
- Date: Mon, 7 Jul 2014 15:38:37 +0000 (UTC)
commit 3a24ecde18b0d9fa32ad52d3df3cabbd4008145e
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Jun 4 14:47:49 2014 +0200
build: "core" helper library for unit tests
The "private" helper library contained only the private classes. But
when a private class needs a symbol from the public classes, there can
be some linking problems.
There is a simpler solution, have all the classes (public and private)
in a "core" helper library. When unit tests link to this core library,
they can use private symbols.
gtksourceview/Makefile.am | 36 ++++++++++++++++++------------------
tests/Makefile.am | 20 +++++++++-----------
2 files changed, 27 insertions(+), 29 deletions(-)
---
diff --git a/gtksourceview/Makefile.am b/gtksourceview/Makefile.am
index 0d98a71..7ab2744 100644
--- a/gtksourceview/Makefile.am
+++ b/gtksourceview/Makefile.am
@@ -49,7 +49,7 @@ libgtksourceview_headers = \
gtksourceutils.h \
gtksourceview.h
-libgtksourceview_private_headers = \
+libgtksourceview_private_headers = \
gtksourcebuffer-private.h \
gtksourcecompletioncontainer.h \
gtksourcecompletionmodel.h \
@@ -71,7 +71,7 @@ libgtksourceview_private_headers = \
gtksourceview-utils.h \
gtktextregion.h
-libgtksourceview_private_c_files = \
+libgtksourceview_private_c_files = \
gtksourcecompletioncontainer.c \
gtksourcecompletionmodel.c \
gtksourcecontextengine.c \
@@ -89,7 +89,7 @@ libgtksourceview_private_c_files = \
gtksourceview-utils.c \
gtktextregion.c
-libgtksourceview_c_files = \
+libgtksourceview_c_files = \
gtksourcebuffer.c \
gtksourcecompletion.c \
gtksourcecompletioncontext.c \
@@ -114,33 +114,33 @@ libgtksourceview_c_files = \
gtksourceutils.c \
gtksourceview.c
-# Split in a helper library for unit tests
-noinst_LTLIBRARIES = libgtksourceview-private.la
+# Split in a helper library, so the private functions can be used in unit tests.
+noinst_LTLIBRARIES = libgtksourceview-core.la
-libgtksourceview_private_la_SOURCES = \
+libgtksourceview_core_la_SOURCES = \
$(libgtksourceview_private_c_files) \
- $(libgtksourceview_private_headers)
+ $(libgtksourceview_private_headers) \
+ $(libgtksourceview_c_files) \
+ $(libgtksourceview_headers)
+
+# do not distribute generated files
+nodist_libgtksourceview_core_la_SOURCES = \
+ $(BUILT_SOURCES)
-libgtksourceview_private_la_CFLAGS = \
+libgtksourceview_core_la_CFLAGS = \
$(CODE_COVERAGE_CFLAGS)
-libgtksourceview_private_la_LDFLAGS = \
- -no-undefined \
+libgtksourceview_core_la_LDFLAGS = \
+ -no-undefined \
$(CODE_COVERAGE_LDFLAGS)
# The real library
lib_LTLIBRARIES = libgtksourceview-3.0.la
-libgtksourceview_3_0_la_SOURCES = \
- $(libgtksourceview_c_files) \
- $(libgtksourceview_headers)
-
-# do not distribute generated files
-nodist_libgtksourceview_3_0_la_SOURCES =\
- $(BUILT_SOURCES)
+libgtksourceview_3_0_la_SOURCES =
libgtksourceview_3_0_la_LIBADD = \
- libgtksourceview-private.la \
+ libgtksourceview-core.la \
completion-providers/words/libgtksourcecompletionwords.la \
$(DEP_LIBS) $(GTK_MAC_LIBS)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b437759..4fd035c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -71,8 +71,7 @@ test_buffer_LDADD = \
UNIT_TEST_PROGS += test-completion-model
test_completion_model_SOURCES = test-completion-model.c
test_completion_model_LDADD = \
- $(top_builddir)/gtksourceview/libgtksourceview-3.0.la \
- $(top_builddir)/gtksourceview/libgtksourceview-private.la \
+ $(top_builddir)/gtksourceview/libgtksourceview-core.la \
$(DEP_LIBS) \
$(TESTS_LIBS)
@@ -118,24 +117,23 @@ test_printcompositor_LDADD = \
UNIT_TEST_PROGS += test-regex
test_regex_SOURCES = test-regex.c
test_regex_LDADD = \
- $(top_builddir)/gtksourceview/libgtksourceview-private.la \
- $(DEP_LIBS) \
- $(GTK_MAC_LIBS) \
+ $(top_builddir)/gtksourceview/libgtksourceview-core.la \
+ $(DEP_LIBS) \
+ $(GTK_MAC_LIBS) \
$(TESTS_LIBS)
UNIT_TEST_PROGS += test-region
test_region_SOURCES = test-region.c
test_region_LDADD = \
- $(top_builddir)/gtksourceview/libgtksourceview-private.la \
- $(DEP_LIBS) \
+ $(top_builddir)/gtksourceview/libgtksourceview-core.la \
+ $(DEP_LIBS) \
$(TESTS_LIBS)
UNIT_TEST_PROGS += test-search-context
test_search_context_SOURCES = test-search-context.c
-test_search_context_LDADD = \
- $(top_builddir)/gtksourceview/libgtksourceview-3.0.la \
- $(top_builddir)/gtksourceview/libgtksourceview-private.la \
- $(DEP_LIBS) \
+test_search_context_LDADD = \
+ $(top_builddir)/gtksourceview/libgtksourceview-core.la \
+ $(DEP_LIBS) \
$(TESTS_LIBS)
UNIT_TEST_PROGS += test-styleschememanager
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]