summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2017-04-07 15:11:38 +0100
committerReuben Thomas <rrt@sc3d.org>2017-04-15 08:55:30 +0100
commit84007e443ba2b7a7d3f1ed17e5ec5294b9e04330 (patch)
tree1dab99787b31aa0d29313e8e4b4d0f98750b3102
parent7ceb97115d78f32530bc7ef6e4205ede672e128f (diff)
downloadenchant-84007e443ba2b7a7d3f1ed17e5ec5294b9e04330.tar.gz
Move tests/mock_provider files up a level
In order to remove Makefile.am duplication
-rw-r--r--configure.ac1
-rw-r--r--tests/EnchantBrokerTestFixture.h2
-rw-r--r--tests/Makefile.am40
-rw-r--r--tests/mock_provider.cpp (renamed from tests/mock_provider/mock_provider.cpp)0
-rw-r--r--tests/mock_provider.h (renamed from tests/mock_provider/mock_provider.h)0
-rw-r--r--tests/mock_provider/Makefile.am39
6 files changed, 37 insertions, 45 deletions
diff --git a/configure.ac b/configure.ac
index 1b74250..34144c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -287,7 +287,6 @@ src/Makefile
providers/Makefile
tests/Makefile
tests/enchant_providers/Makefile
-tests/mock_provider/Makefile
])
AC_OUTPUT
diff --git a/tests/EnchantBrokerTestFixture.h b/tests/EnchantBrokerTestFixture.h
index 92dd781..606268f 100644
--- a/tests/EnchantBrokerTestFixture.h
+++ b/tests/EnchantBrokerTestFixture.h
@@ -30,7 +30,7 @@
#endif
#include "EnchantTestFixture.h"
-#include "mock_provider/mock_provider.h"
+#include "mock_provider.h"
#include <stack>
#include <stdio.h>
#include <gmodule.h>
diff --git a/tests/Makefile.am b/tests/Makefile.am
index f90dfaa..d04886e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = enchant_providers mock_provider
+SUBDIRS = enchant_providers
AM_CPPFLAGS = -I$(top_srcdir)/src $(ENCHANT_CFLAGS)
@@ -12,7 +12,7 @@ AM_TESTS_ENVIRONMENT = \
cp $(top_builddir)/src/libenchant.la $(libdir_subdir)/; \
cp $(top_builddir)/providers/@objdir@/*@shlibext@ $(libdir_subdir)/enchant || :; \
cp $(srcdir)/test.pwl.orig $(builddir)/test.pwl; \
- cp $(builddir)/mock_provider/@objdir@/*@shlibext@ .; \
+ cp $(builddir)/@objdir@/*@shlibext@ .; \
chmod +w $(builddir)/test.pwl;
main_CPPFLAGS = $(AM_CPPFLAGS) $(UNITTESTPP_CFLAGS) -DLIBDIR_SUBDIR=\"$(libdir_subdir)\"
@@ -22,7 +22,7 @@ DISTCLEANFILES = test.pwl *@shlibext@
distclean-local:
rm -rf $(libdir_subdir) $(ENCHANT_CONFIG_DIR)
-EXTRA_DIST = test.pwl.orig
+EXTRA_DIST = test.pwl.orig mock_provider.h
LIBENCHANT_COPY = $(builddir)/$(libdir_subdir)/libenchant.la
$(LIBENCHANT_COPY): $(top_builddir)/src/libenchant.la
@@ -32,8 +32,40 @@ $(LIBENCHANT_COPY): $(top_builddir)/src/libenchant.la
cp $(top_builddir)/src/libenchant.la $(libdir_subdir)/
LDADD = $(LIBENCHANT_COPY) $(ENCHANT_LIBS)
+LIBADD = $(LIBENCHANT_COPY)
DEPS = $(LIBENCHANT_COPY)
+check_LTLIBRARIES = \
+ libenchant_mock_provider.la \
+ libenchant_mock_provider2.la \
+ libenchant_null_provider.la \
+ libenchant_null_identify.la \
+ libenchant_null_describe.la
+
+# Should not really use _ENCHANT_BUILD here, but seems to be necessary to get correct DLL exports for Windows
+libenchant_mock_provider_la_CPPFLAGS=-I$(top_srcdir)/src $(ENCHANT_CFLAGS) -D_ENCHANT_BUILD=1
+# Adding -rpath to LDFLAGS causes the .so to be built even though the lib is not to be installed
+libenchant_mock_provider_la_LDFLAGS = -module -avoid-version -no-undefined -rpath /foo $(ENCHANT_LIBS)
+libenchant_mock_provider_la_SOURCES = mock_provider.cpp
+
+# Build distinct libraries rather than copying a single one, to avoid being
+# defeated by caching, so we can configure each one differently.
+libenchant_mock_provider2_la_CPPFLAGS = $(libenchant_mock_provider_la_CPPFLAGS)
+libenchant_mock_provider2_la_LDFLAGS = $(libenchant_mock_provider_la_LDFLAGS)
+libenchant_mock_provider2_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
+
+libenchant_null_provider_la_CPPFLAGS = $(libenchant_mock_provider_la_CPPFLAGS) -DENCHANT_TEST_NULL_PROVIDER
+libenchant_null_provider_la_LDFLAGS = $(libenchant_mock_provider_la_LDFLAGS)
+libenchant_null_provider_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
+
+libenchant_null_identify_la_CPPFLAGS = $(libenchant_mock_provider_la_CPPFLAGS) -DENCHANT_TEST_NULL_IDENTIFY
+libenchant_null_identify_la_LDFLAGS = $(libenchant_mock_provider_la_LDFLAGS)
+libenchant_null_identify_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
+
+libenchant_null_describe_la_CPPFLAGS = $(libenchant_mock_provider_la_CPPFLAGS) -DENCHANT_TEST_NULL_DESCRIBE
+libenchant_null_describe_la_LDFLAGS = $(libenchant_mock_provider_la_LDFLAGS)
+libenchant_null_describe_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
+
check_PROGRAMS = enchant.test enchantxx.test main
enchant_test_SOURCES = enchant.test.c
@@ -43,7 +75,7 @@ main_SOURCES = main.cpp \
EnchantBrokerTestFixture.h \
EnchantDictionaryTestFixture.h \
EnchantTestFixture.h \
- mock_provider/mock_provider.h \
+ mock_provider.h \
dictionary/enchant_dict_add_tests.cpp \
dictionary/enchant_dict_add_to_session_tests.cpp \
dictionary/enchant_dict_check_tests.cpp \
diff --git a/tests/mock_provider/mock_provider.cpp b/tests/mock_provider.cpp
index 1ea8ff5..1ea8ff5 100644
--- a/tests/mock_provider/mock_provider.cpp
+++ b/tests/mock_provider.cpp
diff --git a/tests/mock_provider/mock_provider.h b/tests/mock_provider.h
index e148c24..e148c24 100644
--- a/tests/mock_provider/mock_provider.h
+++ b/tests/mock_provider.h
diff --git a/tests/mock_provider/Makefile.am b/tests/mock_provider/Makefile.am
deleted file mode 100644
index 5a00894..0000000
--- a/tests/mock_provider/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-EXTRA_DIST = mock_provider.h
-
-# Should not really use _ENCHANT_BUILD here, but seems to be necessary to get correct DLL exports for Windows
-AM_CPPFLAGS=-I$(top_srcdir)/src $(ENCHANT_CFLAGS) -D_ENCHANT_BUILD=1
-
-check_LTLIBRARIES = \
- libenchant_mock_provider.la \
- libenchant_mock_provider2.la \
- libenchant_null_provider.la \
- libenchant_null_identify.la \
- libenchant_null_describe.la
-
-# FIXME: This stanza from tests/Makefile.am because for testing to work this directory must be built first,
-# but the test copy is required in the directory above.
-# When the build system is made non-recursive, this copy of the stanza can be removed.
-LIBENCHANT_COPY = $(builddir)/../$(libdir_subdir)/libenchant.la
-$(LIBENCHANT_COPY): $(top_builddir)/src/libenchant.la
- rm -rf ../$(libdir_subdir)/
- $(MKDIR_P) ../$(libdir_subdir)/enchant
- cp -r $(abs_top_builddir)/src/@objdir@ ../$(libdir_subdir)/
- cp $(abs_top_builddir)/src/libenchant.la ../$(libdir_subdir)/
-
-# Adding -rpath to LDFLAGS causes the .so to be built even though the lib is not to be installed
-AM_LDFLAGS = -module -avoid-version -no-undefined -rpath /foo $(ENCHANT_LIBS)
-LIBADD = $(LIBENCHANT_COPY)
-libenchant_mock_provider_la_SOURCES = mock_provider.cpp
-
-# Build distinct libraries rather than copying a single one, to avoid being
-# defeated by caching, so we can configure each one differently.
-libenchant_mock_provider2_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
-
-libenchant_null_provider_la_CPPFLAGS = $(AM_CPPFLAGS) -DENCHANT_TEST_NULL_PROVIDER
-libenchant_null_provider_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
-
-libenchant_null_identify_la_CPPFLAGS = $(AM_CPPFLAGS) -DENCHANT_TEST_NULL_IDENTIFY
-libenchant_null_identify_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)
-
-libenchant_null_describe_la_CPPFLAGS = $(AM_CPPFLAGS) -DENCHANT_TEST_NULL_DESCRIBE
-libenchant_null_describe_la_SOURCES = $(libenchant_mock_provider_la_SOURCES)