[med-svn] [fw4spl] 04/11: Updated fix_unit_tests patch.

Flavien Bridault fbridault-guest at moszumanska.debian.org
Thu Nov 24 07:50:02 UTC 2016


This is an automated email from the git hooks/post-receive script.

fbridault-guest pushed a commit to branch master
in repository fw4spl.

commit b4ff7bad3e23cb1679a89b245c0c68ca61d8b738
Author: Flavien Bridault <fbridault at ircad.fr>
Date:   Thu Nov 17 16:00:14 2016 +0100

    Updated fix_unit_tests patch.
---
 debian/patches/fix_unit_tests.patch | 251 ++++++------------------------------
 debian/patches/series               |   1 -
 2 files changed, 38 insertions(+), 214 deletions(-)

diff --git a/debian/patches/fix_unit_tests.patch b/debian/patches/fix_unit_tests.patch
index 9e2b816..f673dfc 100644
--- a/debian/patches/fix_unit_tests.patch
+++ b/debian/patches/fix_unit_tests.patch
@@ -4,175 +4,40 @@ Forwarded: no
 Last-Update: 2015-01-05
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
-Index: fw4spl/SrcLib/core/fwRuntime/src/dl/Native.cpp
-===================================================================
---- fw4spl.orig/SrcLib/core/fwRuntime/src/dl/Native.cpp
-+++ fw4spl/SrcLib/core/fwRuntime/src/dl/Native.cpp
-@@ -47,7 +47,11 @@ const ::boost::filesystem::path Native::
- 
-     //replace usr/share by usr/lib to find .so
-     std::string tmp_result = result.string();
--    tmp_result.replace(tmp_result.find("/usr/share"),tmp_result.find("/usr/share")+10,"/usr/lib");
-+    try{
-+        tmp_result.replace(tmp_result.find("/usr/share"),tmp_result.find("/usr/share")+10,"/usr/lib");
-+    } catch(std::exception & e){
-+        OSLM_INFO("Not find un /usr/share because we are running unit test, not the program");
-+    }
-     result = tmp_result;
- 
-     // Test that the result path exists.
-@@ -85,7 +89,11 @@ const ::boost::filesystem::path Native::
-     
-     std::string sFullModulePath = (m_bundle->getLocation() / m_modulePath).string();
-     //replace usr/share by usr/lib to find .so
--    sFullModulePath.replace(sFullModulePath.find("/usr/share"),sFullModulePath.find("/usr/share")+10,"/usr/lib");
-+    try{
-+        sFullModulePath.replace(sFullModulePath.find("/usr/share"),sFullModulePath.find("/usr/share")+10,"/usr/lib");
-+    } catch(std::exception & e){
-+        OSLM_INFO("Not find un /usr/share because we are running unit test, not the program");
-+    }
- 
-     const ::boost::filesystem::path fullModulePath( sFullModulePath );
- #if BOOST_FILESYSTEM_VERSION > 2
-Index: fw4spl/SrcLib/core/fwRuntime/src/io/BundleDescriptorReader.cpp
-===================================================================
---- fw4spl.orig/SrcLib/core/fwRuntime/src/io/BundleDescriptorReader.cpp
-+++ fw4spl/SrcLib/core/fwRuntime/src/io/BundleDescriptorReader.cpp
-@@ -91,7 +91,10 @@ const BundleDescriptorReader::BundleCont
-     if(!completeLocation.is_complete())
-     {
- #ifdef SPECIALINSTALL
--	completeLocation = BUNDLEPATH / location;
-+	completeLocation = SHAREPATH / location;
-+	if( ! ::boost::filesystem::exists(::boost::filesystem::path(completeLocation))){
-+		completeLocation = "share/fw4spl" / location;
-+	}
- #else
- 	completeLocation = ::boost::filesystem::current_path() / location;
- #endif
-@@ -107,6 +110,10 @@ const BundleDescriptorReader::BundleCont
-     std::ostringstream fileLocation;
- #ifdef SPECIALINSTALL
- 	fileLocation << SHAREPATH << "fwRuntime_" <<  FWRUNTIME_VER << "/plugin.xsd";
-+	if( ! ::boost::filesystem::exists(::boost::filesystem::path(fileLocation.str()))){
-+		fileLocation.str("");
-+		fileLocation << "share/fw4spl/" << "fwRuntime_" <<  FWRUNTIME_VER << "/plugin.xsd";
-+	}
- 	const ::boost::filesystem::path pluginXSDLocation(fileLocation.str() );
- #else
- 	fileLocation << "share/fwRuntime_" <<  FWRUNTIME_VER << "/plugin.xsd";
-@@ -188,9 +195,17 @@ const BundleDescriptorReader::BundleCont
- 
-     // Validation
-     std::ostringstream fileLocation;
-+    ::boost::filesystem::path pluginXSDLocation;
- #ifdef SPECIALINSTALL
- 	fileLocation << SHAREPATH << "fwRuntime_" <<  FWRUNTIME_VER << "/plugin.xsd";
--	const ::boost::filesystem::path pluginXSDLocation(fileLocation.str() );
-+	pluginXSDLocation = fileLocation.str();
-+
-+	if( !boost::filesystem::exists(fileLocation.str())){
-+		fileLocation.str("");
-+		fileLocation << "share/fw4spl/fwRuntime_" FWRUNTIME_VER  "/plugin.xsd";
-+		pluginXSDLocation = fileLocation.str();
-+	}
-+
- #else
- 	fileLocation << "share/fwRuntime_" <<  FWRUNTIME_VER << "/plugin.xsd";
- 	const ::boost::filesystem::path pluginXSDLocation(::boost::filesystem::current_path() / fileLocation.str() );
-Index: fw4spl/SrcLib/core/fwRuntime/src/io/ProfileReader.cpp
-===================================================================
---- fw4spl.orig/SrcLib/core/fwRuntime/src/io/ProfileReader.cpp
-+++ fw4spl/SrcLib/core/fwRuntime/src/io/ProfileReader.cpp
-@@ -36,7 +36,7 @@ std::string ProfileReader::DIS_EXT
- 
- //------------------------------------------------------------------------------
- 
--::boost::shared_ptr< ::fwRuntime::profile::Profile > ProfileReader::createProfile( const boost::filesystem::path & path )
-+::boost::shared_ptr< ::fwRuntime::profile::Profile > ProfileReader::createProfile( const boost::filesystem::path & path , bool isUnitTest )
- {
-     // Normalizes the path.
-     boost::filesystem::path normalizedPath(path);
-@@ -51,15 +51,23 @@ std::string ProfileReader::DIS_EXT
- 
-     // Validation
-     std::ostringstream fileLocation;
-+    ::boost::filesystem::path profileXSDLocation;
- #ifdef SPECIALINSTALL
-+	//lancement depuis /usr/... ("mode normal")
- 	fileLocation << SHAREPATH << "fwRuntime_" <<  FWRUNTIME_VER << "/profile.xsd";
--	const ::boost::filesystem::path profileXSDLocation(fileLocation.str() );
-+	profileXSDLocation = fileLocation.str();
-+
-+	if( isUnitTest || !boost::filesystem::exists(fileLocation.str())){
-+		fileLocation.str("");
-+		fileLocation << "share/fw4spl/fwRuntime_" FWRUNTIME_VER  "/profile.xsd";
-+		profileXSDLocation = fileLocation.str();
-+	}
-+
- #else
- 	fileLocation << "share/fwRuntime_" <<  FWRUNTIME_VER << "/profile.xsd";
--	const ::boost::filesystem::path profileXSDLocation(::boost::filesystem::current_path() / fileLocation.str() );
-+	profileXSDLocation =::boost::filesystem::current_path() / fileLocation.str();
- #endif
- 
--
-     Validator   validator(profileXSDLocation);
- 
-     if( validator.validate(normalizedPath) == false )
-Index: fw4spl/CMakeLists.txt
-===================================================================
 --- fw4spl.orig/CMakeLists.txt
 +++ fw4spl/CMakeLists.txt
-@@ -9,7 +9,7 @@ include(CheckVariableExists)
- include(CMakeParseArguments)
+@@ -84,7 +84,7 @@
  
- option(CLASSIC_INSTALL ON)
--set(CLASSIC_INSTALL OFF)
-+#set(CLASSIC_INSTALL OFF)
- set( EXTERNAL_LIBRARIES ${CMAKE_CURRENT_SOURCE_DIR}/CMake/Modules/ )
+         #To make a debian package we should install our bundle in /usr/share/...
+         if(DEBIAN_INSTALL)
+-            set(BUNDLE_PREFIX "share/Bundles")
++            set(BUNDLE_PREFIX "share/fw4spl")
+         endif()
+ 
+     endif()
+@@ -390,7 +390,7 @@
+         add_dependencies( ${FWPROJECT_NAME} ${FWPROJECT_NAME}_rc )
  
- if(CLASSIC_INSTALL)
-@@ -275,7 +275,7 @@ macro(fwCppunitTest FWPROJECT_NAME)
          if(${FWPROJECT_NAME}_INSTALL)
-             createResourcesInstallTarget( "${PRJ_SOURCE_DIR}/tu/rc"
-                 "${${FWPROJECT_NAME}_RC_BUILD_DIR}" 
--                "unittest/tu_exec_${DIRNAME}_${DASH_VERSION}" )
-+                "${SHARE_OUTPUT_DIR}/tu_exec_${DIRNAME}_${DASH_VERSION}" )
+-            createResourcesInstallTarget( "${${FWPROJECT_NAME}_RC_BUILD_DIR}" "share/tu_exec_${DIRNAME}_${DASH_VERSION}" )
++		createResourcesInstallTarget( "${${FWPROJECT_NAME}_RC_BUILD_DIR}" "${SHARE_OUTPUT_DIR}/share/tu_exec_${DIRNAME}_${DASH_VERSION}" )
          endif()
      endif()
  
-Index: fw4spl/SrcLib/core/fwRuntime/include/fwRuntime/io/ProfileReader.hpp
-===================================================================
 --- fw4spl.orig/SrcLib/core/fwRuntime/include/fwRuntime/io/ProfileReader.hpp
 +++ fw4spl/SrcLib/core/fwRuntime/include/fwRuntime/io/ProfileReader.hpp
-@@ -52,7 +52,7 @@ struct ProfileReader
-      *
+@@ -52,7 +52,7 @@
       * @param[in]   path    a path to an xml profile file
       */
--    FWRUNTIME_API static ::boost::shared_ptr< ::fwRuntime::profile::Profile > createProfile( const boost::filesystem::path & path );
-+    FWRUNTIME_API static ::boost::shared_ptr< ::fwRuntime::profile::Profile > createProfile( const boost::filesystem::path & path , bool isUnitTest=false );
+     FWRUNTIME_API static std::shared_ptr< ::fwRuntime::profile::Profile > createProfile(
+-        const boost::filesystem::path & path );
++        const boost::filesystem::path & path, bool isUnitTest=false );
  
  
  
-Index: fw4spl/CMake/cppunit/cppunit_main.cpp
-===================================================================
 --- fw4spl.orig/CMake/cppunit/cppunit_main.cpp
 +++ fw4spl/CMake/cppunit/cppunit_main.cpp
-@@ -31,11 +31,7 @@ class MiniLauncher
- public:
-     MiniLauncher( ::boost::filesystem::path profilePath )
-     {
--	#ifdef SPECIALINSTALL
--    		::boost::filesystem::path cwd = SHAREPATH;
--	#else
--		::boost::filesystem::path cwd = ::boost::filesystem::current_path();
--	#endif
-+	::boost::filesystem::path cwd = ::boost::filesystem::current_path();
- 
-         ::boost::filesystem::path bundlePath = cwd / "Bundles";
- 
-@@ -52,7 +48,7 @@ public:
+@@ -53,7 +53,7 @@
          }
  
  
@@ -181,31 +46,6 @@ Index: fw4spl/CMake/cppunit/cppunit_main.cpp
          ::fwRuntime::profile::setCurrentProfile(m_profile);
  
          m_profile->setParams(0, NULL);
-Index: fw4spl/launcher/src/ProfileRunner.cpp
-===================================================================
---- fw4spl.orig/launcher/src/ProfileRunner.cpp
-+++ fw4spl/launcher/src/ProfileRunner.cpp
-@@ -114,11 +114,17 @@ int main(int argc, char* argv[])
-     PathType profileFile;
-     ::fwRuntime::profile::Profile::ParamsContainer profileArgs;
- 
-+    std::string bundles_p;
-+    if(boost::filesystem::exists(BUNDLEPATH))
-+	bundles_p = BUNDLEPATH;
-+    else
-+	bundles_p = "Bundles";
-+
-     po::options_description options("Launcher options");
- #ifdef SPECIALINSTALL
- 	options.add_options()
-         ("help,h", "Show help message")
--        ("bundle-path,B", po::value(&bundlePaths)->default_value(PathListType(1,BUNDLEPATH)),
-+        ("bundle-path,B", po::value(&bundlePaths)->default_value(PathListType(1,bundles_p)),
- "Adds a bundle path")
-         ("rwd", po::value(&rwd)->default_value("./"), "Sets runtime working directory")
-         ;
-Index: fw4spl/SrcLib/core/fwActivities/test/tu/src/builder/ActivitySeriesBuilderTest.cpp
-===================================================================
 --- fw4spl.orig/SrcLib/core/fwActivities/test/tu/src/builder/ActivitySeriesBuilderTest.cpp
 +++ fw4spl/SrcLib/core/fwActivities/test/tu/src/builder/ActivitySeriesBuilderTest.cpp
 @@ -18,6 +18,9 @@
@@ -218,20 +58,16 @@ Index: fw4spl/SrcLib/core/fwActivities/test/tu/src/builder/ActivitySeriesBuilder
  #include "builder/ActivitySeriesBuilderTest.hpp"
  
  
-@@ -35,9 +38,9 @@ void ActivitySeriesBuilderTest::setUp()
+@@ -34,7 +37,8 @@
+ void ActivitySeriesBuilderTest::setUp()
  {
      // Set up context before running a test.
- #ifdef SPECIALINSTALL
--	::boost::filesystem::path plugin = std::string(SHAREPATH)+"tu_exec_fwActivities_0-0/tu_builder";
-+	::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "../share/fw4spl/tu_exec_fwActivities_0-0/tu_builder";
- #else
--	::boost::filesystem::path plugin = "share/tu_exec_fwActivities_0-0/tu_builder";
-+	::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "share/tu_exec_fwActivities_0-0//tu_builder";
- #endif
+-    ::boost::filesystem::path plugin = "share/tu_exec_fwActivities_0-0/tu_builder";
++    ::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "../share/fw4spl/tu_exec_fwActivities_0-0/tu_builder";
++
+     m_bundle                         = ::fwRuntime::io::BundleDescriptorReader::createBundle(plugin);
  
-     m_bundle = ::fwRuntime::io::BundleDescriptorReader::createBundle(plugin);
-Index: fw4spl/SrcLib/core/fwActivities/test/tu/src/registry/ActivityRegistryTest.cpp
-===================================================================
+     m_activities = ::fwActivities::registry::Activities::New();
 --- fw4spl.orig/SrcLib/core/fwActivities/test/tu/src/registry/ActivityRegistryTest.cpp
 +++ fw4spl/SrcLib/core/fwActivities/test/tu/src/registry/ActivityRegistryTest.cpp
 @@ -18,6 +18,9 @@
@@ -244,20 +80,15 @@ Index: fw4spl/SrcLib/core/fwActivities/test/tu/src/registry/ActivityRegistryTest
  #include "registry/ActivityRegistryTest.hpp"
  
  
-@@ -35,9 +38,9 @@ void ActivityRegistryTest::setUp()
+@@ -42,7 +45,7 @@
  {
+     m_pimpl = std::make_shared< ActivityRegistryTestPimpl >();
  
- #ifdef SPECIALINSTALL
--	::boost::filesystem::path plugin = std::string(SHAREPATH)+"tu_exec_fwActivities_0-0/tu_registry";
-+	::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "../share/fw4spl/tu_exec_fwActivities_0-0/tu_registry";
- #else
--	::boost::filesystem::path plugin = "share/tu_exec_fwActivities_0-0/tu_registry";
-+	::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "share//tu_exec_fwActivities_0-0/tu_registry";
- #endif
-     m_bundle = ::fwRuntime::io::BundleDescriptorReader::createBundle(plugin);
+-    ::boost::filesystem::path plugin = "share/tu_exec_fwActivities_0-0/tu_registry";
++    ::boost::filesystem::path plugin = ::boost::filesystem::current_path() / "../share/fw4spl/tu_exec_fwActivities_0-0/tu_builder";
+     m_pimpl->bundle                  = ::fwRuntime::io::BundleDescriptorReader::createBundle(plugin);
  
-Index: fw4spl/SrcLib/patch/fwMDSemanticPatch/src/fwMDSemanticPatch/PatchLoader.cpp
-===================================================================
+     m_pimpl->activities = fwActivities::registry::Activities::New();
 --- fw4spl.orig/SrcLib/patch/fwMDSemanticPatch/src/fwMDSemanticPatch/PatchLoader.cpp
 +++ fw4spl/SrcLib/patch/fwMDSemanticPatch/src/fwMDSemanticPatch/PatchLoader.cpp
 @@ -6,6 +6,8 @@
@@ -269,20 +100,14 @@ Index: fw4spl/SrcLib/patch/fwMDSemanticPatch/src/fwMDSemanticPatch/PatchLoader.c
  #include "fwMDSemanticPatch/PatchLoader.hpp"
  
  namespace fwMDSemanticPatch
-@@ -14,9 +16,14 @@ namespace fwMDSemanticPatch
+@@ -14,8 +16,8 @@
  void PatchLoader::loadPatches()
  {
      SPTR(::fwAtomsPatch::VersionsManager) versionManager = ::fwAtomsPatch::VersionsManager::getDefault();
-+
-     #ifdef SPECIALINSTALL
--	versionManager->buildVersionTable(SHAREPATH "fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
--	versionManager->buildLinkTable(SHAREPATH "fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
-+	std::string location = SHAREPATH;
-+	if( !boost::filesystem::exists(location)){
-+		location = "share/fw4spl/";
-+	}
-+	versionManager->buildVersionTable(location + "fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
-+	versionManager->buildLinkTable(location + "fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
-     #else
- 	versionManager->buildVersionTable("./share/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
- 	versionManager->buildLinkTable("./share/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
+-    versionManager->buildVersionTable("./share/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
+-    versionManager->buildLinkTable("./share/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
++    versionManager->buildVersionTable("./share/fw4spl/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
++    versionManager->buildLinkTable("./share/fw4spl/fwMDSemanticPatch_" FWMDSEMANTICPATCH_VER "/");
+ }
+ 
+ //------------------------------------------------------------------------------
diff --git a/debian/patches/series b/debian/patches/series
index 2a569ce..85c2fd8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 fix_unit_tests.patch
-fix_missing_hdf5.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/fw4spl.git



More information about the debian-med-commit mailing list