[glom] Fix the tests build during distcheck



commit 60129d7066f8b6cddbe8c38b092c14e80800d94f
Author: Murray Cumming <murrayc murrayc com>
Date:   Tue Nov 23 14:19:31 2010 +0100

    Fix the tests build during distcheck
    
    	* Makefile_glom.am: Correct eggspreadtablemm.c to eggspreadtablemm.cc.
    	* Makefile.am:
    	* Makefile_tests.am: Distribute the albums.csv test file and put the
    	path to its directory in a define.
    	* tests/import/test_parsing.cc: Use the define here, instead of using
    	get_current_directory, which is not enough when builddir!=srcdir.

 ChangeLog                    |   29 ++++++++++++++++++++---------
 Makefile.am                  |    7 +++++--
 Makefile_glom.am             |    2 +-
 Makefile_tests.am            |   13 ++++++++++++-
 tests/import/test_parsing.cc |    5 +++--
 5 files changed, 41 insertions(+), 15 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 9e1fbc4..77c6140 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,19 @@
+2010-11-23  Murray Cumming  <murrayc murrayc com>
+
+	Fix the tests build during distcheck
+
+	* Makefile_glom.am: Correct eggspreadtablemm.c to eggspreadtablemm.cc.
+	* Makefile.am:
+	* Makefile_tests.am: Distribute the albums.csv test file and put the
+	path to its directory in a define.
+	* tests/import/test_parsing.cc: Use the define here, instead of using
+	get_current_directory, which is not enough when builddir!=srcdir.
+
 2010-11-17  Javier Jardón  <jjardon gnome org>
 
 	Use upstream gettext instead Glib one
 
-	* configure.ac: Do not use AM_GLIB_GNU_GETTEXT() because it is no longer 
+	* configure.ac: Do not use AM_GLIB_GNU_GETTEXT() because it is no longer
 	maintained/recommended.
 	This fixes bug #631367
 
@@ -10,22 +21,22 @@
 
 	Import tests: Uncomment some tests and make them test what we really want.
 
-	* tests/import/test_parsing.cc: Check that we do _not_ require ending newlines 
+	* tests/import/test_parsing.cc: Check that we do _not_ require ending newlines
 	and check that we do _not_ require quotes around items.
 
 2010-11-15  Murray Cumming  <murrayc murrayc com>
 
 	Import tests: Disable more tests that do not seem useful.
 
-	* tests/import/test_parsing.cc: Comment out the non-comma separators test and 
-	the ignoring-space-between-quoted-text test, because they don't seem to 
+	* tests/import/test_parsing.cc: Comment out the non-comma separators test and
+	the ignoring-space-between-quoted-text test, because they don't seem to
 	correspond to any specification.
 
 2010-11-15  Murray Cumming  <murrayc murrayc com>
 
 	Import tests: Disable tests that check for incorrect or useless behaviour.
 
-	* tests/import/test_parsing.cc: Comment out the test to ensure that we 
+	* tests/import/test_parsing.cc: Comment out the test to ensure that we
 	- Ignore rows with no ending newline.
 	- Ignore field values that are not quoted.
 	because we should not do that.
@@ -36,11 +47,11 @@
 	Re-enable the import tests and partially deal with their race condition.
 
 	* Makefile_tests.am: Re-enable the import tests.
-	* glom/import_csv/csv_parser.[h|cc]: Add ensure_idle_handler_connection(), 
-	moving the idle signal handler connection there. Also call it from the 
-	beginning and end of on_file_read(), in case it has been disconnected 
+	* glom/import_csv/csv_parser.[h|cc]: Add ensure_idle_handler_connection(),
+	moving the idle signal handler connection there. Also call it from the
+	beginning and end of on_file_read(), in case it has been disconnected
 	too early.
-	Use a priority less than PRIORITY_DEFAULT_IDLE, so that IO is likely to 
+	Use a priority less than PRIORITY_DEFAULT_IDLE, so that IO is likely to
 	happen more often than the idle callback.
 
 2010-11-12  Murray Cumming  <murrayc murrayc com>
diff --git a/Makefile.am b/Makefile.am
index cc2a8ef..37ca787 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -98,7 +98,8 @@ dist_example_DATA =				\
 	examples/example_project_manager.glom	\
 	examples/example_smallbusiness.glom
 
-dist_noinst_DATA = examples/sqlite/test_sqlite_music/test_sqlite_music.glom
+# We use += because we set this first in Makefile_tests.am:
+dist_noinst_DATA += examples/sqlite/test_sqlite_music/test_sqlite_music.glom
 
 iconthemedir = $(datadir)/icons/hicolor
 appicon16dir = $(iconthemedir)/16x16/apps
@@ -179,7 +180,9 @@ MAINTAINERCLEANFILES = \
 glom_localedir = $(prefix)/$(DATADIRNAME)/locale
 
 glom_includes = -I$(top_builddir)/glom -I$(top_srcdir)/glom -I$(top_builddir) -I$(top_srcdir)
-glom_defines = \
+
+# We use += because this is set first in Makefile_tests.am:
+glom_defines += \
 -DGLOM_DATADIR=\""$(datadir)"\" \
 -DGLOM_DOCDIR_EXAMPLES=\""$(docdir)/examples"\" \
 -DGLOM_DOCDIR_EXAMPLES_NOTINSTALLED=\""$(abs_top_srcdir)/examples"\" \
diff --git a/Makefile_glom.am b/Makefile_glom.am
index 0ab3ebe..8196364 100644
--- a/Makefile_glom.am
+++ b/Makefile_glom.am
@@ -167,7 +167,7 @@ glom_source_files = \
 	glom/utility_widgets/flowtable.h				\
 	glom/utility_widgets/eggspreadtable/eggspreadtable.c \
 	glom/utility_widgets/eggspreadtable/eggspreadtable.h \
-	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.c \
+	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.cc \
 	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.h \
 	glom/utility_widgets/eggspreadtablemm/private/eggspreadtablemm_p.h \
 	glom/utility_widgets/imageglom.cc				\
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 8571f36..72630f4 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -92,12 +92,23 @@ tests_test_python_execute_func_change_result_type_SOURCES = tests/test_python_ex
 	glom/python_embed/glom_python.cc
 tests_test_python_execute_script_SOURCES = tests/test_python_execute_script.cc \
 	glom/python_embed/glom_python.cc
+
+
+# Distribute the tests data:
+dist_noinst_DATA = tests/import/data/albums.csv
+
+# Let the .cc source code know about this path:
+glom_defines = \
+-DGLOM_TESTS_IMPORT_DATA_NOTINSTALLED=\""$(abs_top_srcdir)/tests/import/data/"\"
+
 tests_import_test_parsing_SOURCES =	\
 	glom/import_csv/csv_parser.cc	\
 	glom/import_csv/csv_parser.h	\
 	tests/import/utils.cc\
 	tests/import/utils.h\
 	tests/import/test_parsing.cc
+
+
 tests_import_test_signals_SOURCES =	\
 	glom/import_csv/csv_parser.cc	\
 	glom/import_csv/csv_parser.h	\
@@ -117,7 +128,7 @@ glom_utility_widgets_test_flowtable_SOURCES =	\
 	glom/utility_widgets/flowtable.h	\
 	glom/utility_widgets/eggspreadtable/eggspreadtable.c \
 	glom/utility_widgets/eggspreadtable/eggspreadtable.h \
-	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.c \
+	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.cc \
 	glom/utility_widgets/eggspreadtablemm/eggspreadtablemm.h \
 	glom/utility_widgets/eggspreadtablemm/private/eggspreadtablemm_p.h \
 	glom/utility_widgets/test_flowtable.cc
diff --git a/tests/import/test_parsing.cc b/tests/import/test_parsing.cc
index 5a9e2e1..bb44403 100644
--- a/tests/import/test_parsing.cc
+++ b/tests/import/test_parsing.cc
@@ -203,7 +203,9 @@ int main(int argc, char* argv[])
   // test_import_csv_file
   {
     // filename_to_uri expects absolute filenames
-    const std::string filename = Glib::build_filename(Glib::get_current_dir(), "tests/import/data/albums.csv");
+    const std::string filename =
+       Glib::build_filename(GLOM_TESTS_IMPORT_DATA_NOTINSTALLED,
+         "albums.csv");
     const bool finished_parsing = ImportTests::run_parser_on_file(&connect_signals, Glib::filename_to_uri(filename));
     const bool passed = (finished_parsing &&
                          8450 == get_tokens_instance().size());
@@ -219,4 +221,3 @@ int main(int argc, char* argv[])
 
   return result ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-



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