eeze: Make sure we use the modules from the current build for make check.
authorStefan Schmidt <stefan@datenfreihafen.org>
Tue, 11 Dec 2012 16:48:39 +0000 (16:48 +0000)
committerStefan Schmidt <stefan@datenfreihafen.org>
Tue, 11 Dec 2012 16:48:39 +0000 (16:48 +0000)
Befoe this we always used the installed modules from the system. That is often
fine but there are cases we would need the local. un-installed, modules. The
coverage check is a example. The system modules normally don't had the options
for coverage enabled and thus would not produce anything for the modules.

Default still stays as it was. You would need to set an env var to use the
local modules.

SVN revision: 80670

legacy/eeze/Makefile.am
legacy/eeze/src/lib/Makefile.am
legacy/eeze/src/lib/eeze_sensor.c

index 8f2609c..8af59fd 100644 (file)
@@ -60,9 +60,9 @@ lcov-report:
        @echo "Coverage Report at $(top_builddir)/coverage/html"
 
 check-local:
-       @$(MAKE) lcov-reset
-       @./src/tests/eeze_suite
-       @$(MAKE) lcov-report
+       @$(MAKE) $(AM_MAKEFLAGS) lcov-reset
+       @EEZE_USE_IN_TREE_MODULES=1 ./src/tests/eeze_suite
+       @$(MAKE) $(AM_MAKEFLAGS) lcov-report
 
 else
 
index cadc460..0b4ec33 100644 (file)
@@ -1,6 +1,7 @@
 MAINTAINERCLEANFILES = Makefile.in
 
 AM_CPPFLAGS = @EEZE_CFLAGS@ \
+-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)\" \
 -DPACKAGE_LIB_DIR=\"$(libdir)\"
 
 includes_HEADERS = Eeze.h Eeze_Net.h Eeze_Sensor.h
index 77508ba..7122514 100644 (file)
@@ -66,9 +66,14 @@ eeze_sensor_obj_get(Eeze_Sensor_Type sensor_type)
 static void
 eeze_sensor_modules_load(void)
 {
-   /* Check for available runtime modules and load them */
-   g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eeze-sensor/", 0, NULL, NULL);
-   /* FIXME check for modules also in HOME and other locations */
+   /* Check for available runtime modules and load them. In some cases the
+    * un-installed modules to be used from the local build dir. Coverage check
+    * is one of these items. We do load the modules from the builddir if the
+    * environment is set. Normal case is to use installed modules from system */
+   if (getenv("EEZE_USE_IN_TREE_MODULES"))
+      g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_BUILD_DIR "/src/modules/.libs/", 0, NULL, NULL);
+   else
+      g_handle->modules_array = eina_module_list_get(NULL, PACKAGE_LIB_DIR "/eeze-sensor/", 0, NULL, NULL);
 
    if (!g_handle->modules_array)
      {