← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/zorba-tests-when-installed-fix into lp:zorba

 

Ghislain Fourny has proposed merging lp:~zorba-coders/zorba/zorba-tests-when-installed-fix into lp:zorba.

Requested reviews:
  Matthias Brantner (matthias-brantner)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/zorba-tests-when-installed-fix/+merge/109160

This fix should bring the failing tests down to 7% in case Zorba is installed on the machine. It swaps the lib path resolution strategy from top-down to bottom-up through the static context, so that the lib path provided on the command line (in the build directory for a test) takes priority over the root static context's builtin module paths (the first one being in the install directory). Some of the remaining failing tests are probably still failing because the test executables also need to be adapted to override the lib path through their command line (so far this is done for rbkt tests only).

Normally, this fix should not lead to any regression in the case Zorba is not installed.

-- 
https://code.launchpad.net/~zorba-coders/zorba/zorba-tests-when-installed-fix/+merge/109160
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'cmake_modules/ZorbaModule.cmake'
--- cmake_modules/ZorbaModule.cmake	2012-05-30 00:33:21 +0000
+++ cmake_modules/ZorbaModule.cmake	2012-06-07 14:46:29 +0000
@@ -806,7 +806,7 @@
       ADD_TEST(${TESTNAME} "${Zorba_TESTDRIVER}"
 	"--rbkt-src" "${TEST_DIR}"
 	"--module-path"
-	"${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${DEPENDENCY_MODULE_PATH}"
+	"${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${CMAKE_BINARY_DIR}/LIB_PATH/${PATH_SEP}${DEPENDENCY_MODULE_PATH}"
 	"${TESTFILE}")
 
       # On non-Windows, call EXPECTED_FAILURE() for known crashes

=== modified file 'src/context/static_context.cpp'
--- src/context/static_context.cpp	2012-05-18 22:01:56 +0000
+++ src/context/static_context.cpp	2012-06-07 14:46:29 +0000
@@ -1722,12 +1722,12 @@
 ********************************************************************************/
 void static_context::get_full_lib_path(std::vector<zstring>& path) const
 {
+  get_lib_path(path);
+
   if (theParent != NULL)
   {
     theParent->get_full_lib_path(path);
   }
-
-  get_lib_path(path);
 }
 
 

=== modified file 'test/rbkt/Queries/CMakeLists.txt'
--- test/rbkt/Queries/CMakeLists.txt	2012-05-09 20:29:48 +0000
+++ test/rbkt/Queries/CMakeLists.txt	2012-06-07 14:46:29 +0000
@@ -128,6 +128,12 @@
   FIND_PACKAGE(CURL)
 ENDIF(ZORBA_SUPPRESS_CURL)
 
+IF(WIN32)
+  SET(PATH_SEP ",")
+ELSE(WIN32)
+  SET(PATH_SEP ":")
+ENDIF(WIN32)
+
 
 FOREACH(TESTFILE ${TESTFILES})
   # All testfile paths end in .xq or .xqx. Strip that part off to form
@@ -195,7 +201,11 @@
 
   IF(NOT SKIP_TEST)
 
-    ZORBA_ADD_TEST("${TESTNAME}" testdriver ${TESTFILE})
+    ZORBA_ADD_TEST("${TESTNAME}"
+                   testdriver
+                   "--module-path"
+                   "${CMAKE_BINARY_DIR}/URI_PATH/${PATH_SEP}${CMAKE_BINARY_DIR}/LIB_PATH/"
+                   "${TESTFILE}")
 
     MATH(EXPR TESTCOUNTER ${TESTCOUNTER}+1)
     MATH(EXPR TESTMOD "${TESTCOUNTER}/1000")


Follow ups