[glom] Added dlopen test of the python library.



commit abe4d5519e0bdee08f075ff46b5722eae4f63d97
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Sep 5 00:18:36 2009 +0200

    Added dlopen test of the python library.
    
    * glom/libglom/test_connectionpool.cc:
    * glom/libglom/test_document.cc: Fixed the build without exceptions.
    * Makefile_tests.am: Added test_load_python_library, using dlopen()
    to show the numpunct linker error (bug #594142) without actually using
    python.

 ChangeLog                           |   10 ++++++++++
 Makefile_tests.am                   |    8 ++++++--
 glom/libglom/test_connectionpool.cc |    2 +-
 glom/libglom/test_document.cc       |    5 +++++
 4 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d08ef32..d017caf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-09-05  Murray Cumming  <murrayc murrayc com>
+
+	Added dlopen test of the python library.
+
+	* glom/libglom/test_connectionpool.cc:
+	* glom/libglom/test_document.cc: Fixed the build without exceptions.
+	* Makefile_tests.am: Added test_load_python_library, using dlopen() 
+	to show the numpunct linker error (bug #594142) without actually using 
+	python.
+
 2009-09-04  Daniel Elstner  <daniel kitta gmail com>
 
 	Do not try to catch non-existing MetaStructError
diff --git a/Makefile_tests.am b/Makefile_tests.am
index 2966e82..6e95bd0 100644
--- a/Makefile_tests.am
+++ b/Makefile_tests.am
@@ -23,10 +23,12 @@ check_PROGRAMS =						\
 	glom/utility_widgets/egg/toolpalette/testtoolpalette	\
 	glom/test_pyembed					\
 	regression_tests/test_parsing_time			\
-	regression_tests/test_signal_reemit
+	regression_tests/test_signal_reemit			\
+	regression_tests/test_load_python_library
 
 TESTS =	regression_tests/test_parsing_time	\
-	regression_tests/test_signal_reemit
+	regression_tests/test_signal_reemit	\
+	regression_tests/test_load_python_library
 
 tests_ldadd = glom/libglom/libglom-$(GLOM_ABI_VERSION).la $(LIBGLOM_LIBS)
 
@@ -36,6 +38,7 @@ glom_libglom_test_sharedptr_layoutitem_SOURCES = glom/libglom/test_sharedptr_lay
 glom_test_pyembed_SOURCES = glom/test_pyembed.cc
 regression_tests_test_parsing_time_SOURCES = regression_tests/test_parsing_time.cc
 regression_tests_test_signal_reemit_SOURCES = regression_tests/test_signal_reemit.cc
+regression_tests_test_load_python_library_SOURCES = regression_tests/test_load_python_library.cc
 
 glom_libglom_test_connectionpool_LDADD = $(tests_ldadd)
 glom_libglom_test_document_LDADD = $(tests_ldadd)
@@ -59,3 +62,4 @@ glom_test_pyembed_LDADD = $(LIBGLOM_LIBS) $(PYTHON_LIBS)
 
 regression_tests_test_parsing_time_LDADD = $(tests_ldadd)
 regression_tests_test_signal_reemit_LDADD = $(LIBGLOM_LIBS)
+regression_tests_test_load_python_library_LDADD = $(LIBGLOM_LIBS)
diff --git a/glom/libglom/test_connectionpool.cc b/glom/libglom/test_connectionpool.cc
index a71af8e..9e1ff0e 100644
--- a/glom/libglom/test_connectionpool.cc
+++ b/glom/libglom/test_connectionpool.cc
@@ -67,7 +67,7 @@ main()
     #ifdef GLIBMM_EXCEPTIONS_ENABLED
     connection = Glom::ConnectionPool::get_and_connect();
     #else
-    std::auto_ptr<ExceptionConnection> error;
+    std::auto_ptr<Glom::ExceptionConnection> error;
     connection = Glom::ConnectionPool::get_and_connect(error);
     #endif
 
diff --git a/glom/libglom/test_document.cc b/glom/libglom/test_document.cc
index c4a03e1..e1eb476 100644
--- a/glom/libglom/test_document.cc
+++ b/glom/libglom/test_document.cc
@@ -76,6 +76,7 @@ int main()
   // Get a URI for a test file:
   Glib::ustring uri;
 
+  #ifdef GLIBMM_EXCEPTIONS_ENABLED
   try
   {
     uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom");
@@ -85,6 +86,10 @@ int main()
     std::cerr << "Exception from Glib::filename_to_uri(): " << ex.what();
     return 1;
   }
+  #else
+  std::auto_ptr<Glib::Error> ex;
+  uri = Glib::filename_to_uri("/usr/share/glom/doc/examples/example_music_collection.glom", ex);
+  #endif
 
   std::cout << "URI=" << uri << std::endl;
 



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