]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Merge branch 'abn/tests_from_build'
authorabn <adrien.bruneton@cea.fr>
Mon, 4 Jan 2016 11:36:25 +0000 (12:36 +0100)
committerabn <adrien.bruneton@cea.fr>
Mon, 4 Jan 2016 11:36:25 +0000 (12:36 +0100)
Conflicts:
src/INTERP_KERNELTest/TestInterpKernelUtils.cxx
src/MEDLoader/Test/MEDLoaderTest.cxx
src/MEDLoader/Test/SauvLoaderTest.cxx
src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx

1  2 
src/INTERP_KERNELTest/TestInterpKernelUtils.cxx
src/INTERP_KERNELTest/TestInterpKernelUtils.hxx
src/MEDLoader/Test/SauvLoaderTest.cxx
src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx

index 5adeb43fc15ee2b67c8588b9550ef92fff8b29f0,2275c57b0a939d7a62feb5dc98c0b2271759a37d..25b1c1154755d695bf2b5f6c4f2928aae2349540
@@@ -44,19 -37,21 +42,21 @@@ namespace INTERP_TES
        resourceFile += filename;
        std::ifstream my_file(resourceFile);
        if (my_file.good())
-         good = true;
+         return resourceFile;
      }
-     if (!good)
+     // else
 -    resourceFile = get_current_dir_name();
 -    resourceFile += IK_PATH_SEP;
++    resourceFile = getcwd(NULL, 0);
++    resourceFile += "/";
+     for(int i=0; i<levelUp; i++)
 -      resourceFile += ".." + IK_PATH_SEP;
 -    resourceFile += "resources" + IK_PATH_SEP;
++      resourceFile += "../";
++    resourceFile += "resources/";
+     resourceFile += filename;
+     std::ifstream my_file(resourceFile);
+     if (!my_file.good())
        {
-         resourceFile = getcwd(NULL, 0);
-         resourceFile += "/../../resources/";
-         std::ifstream my_file(resourceFile);
-         if (!my_file.good())
-           {
-             std::stringstream ss;
-             ss << "INTERP_TEST::getResourceFile(): could not open resource test file: " << filename << "\n";
-             throw INTERP_KERNEL::Exception(ss.str().c_str());
-           }
+         std::stringstream ss;
+         ss << "INTERP_TEST::getResourceFile(): could not open resource test file: " << filename << "\n";
+         throw INTERP_KERNEL::Exception(ss.str().c_str());
        }
  
      return resourceFile;
index d17240a7f5bb867d38eefa4c7ebdac28faaf8cff,6d249e096591e50441d986fb93bedf11a49d3c9d..9edf18f0d3ffbbc3eb6b147408d0bae2b17083b2
  #define _TESTINTERPKERNELUTILS_HXX_
  
  #include "InterpKernelTestExport.hxx"
--
  #include <string>
  
 -#ifdef WIN32
 -# define IK_PATH_SEP std::string("\\")
 -#else
 -# define IK_PATH_SEP std::string("/")
 -#endif
 -
  namespace INTERP_TEST
  {
-   INTERPKERNELTEST_EXPORT std::string getResourceFile( const std::string& );
- } // namespace INTERP_TEST
+   INTERPKERNELTEST_EXPORT std::string getResourceFile( const std::string& filename, int levelUp=2);
+ }
  
  #endif // _TESTINTERPKERNELUTILS_HXX_
index 1674cffecc6a5bf087ba6d023929f8ea5d8ab291,66fbcda6b31ce6ff23df870f4bee6636ff30c221..a7bdb44fbd52f4e879b2048e06f1ea306e393bd4
  #include "MEDFileData.hxx"
  #include "MEDCouplingFieldDouble.hxx"
  #include "MEDCouplingMemArray.hxx"
+ #include "TestInterpKernelUtils.hxx"  // getResourceFile()
  
  #ifdef WIN32
 -# include <windows.h>
 +#include <windows.h>
- #include <direct.h>
- #define getcwd _getcwd
  #else
  # include <unistd.h>
  #endif
index 30c3a863eaa987cc1004815c1bcc3fdb43b2494d,505d48366380d7e9a124bbcf59015f037ccb4130..b25af62b83fe967ada34c9d182c2f033cc476c04
@@@ -94,14 -89,15 +94,14 @@@ std::string MEDPARTITIONERTest::getPart
      {
        execName=getenv("MEDCOUPLING_ROOT_DIR");  //.../INSTALL/MED
        execName+="/bin/medpartitioner";
+       std::ifstream my_file(execName);
+       if (my_file.good())
+         return execName;
      }
-   else
-     {
-       execName = getcwd(NULL, 0);
-       execName += "/../../MEDPartitioner/medpartitioner";
-       if (! std::ifstream(execName.c_str()))
-         CPPUNIT_FAIL("Can't find medpartitioner, please set MEDCOUPLING_ROOT_DIR");
-     }
 -  execName = get_current_dir_name();
++  execName = getcwd(NULL, 0);
+   execName += "/../../MEDPartitioner/medpartitioner";
+   if (! std::ifstream(execName.c_str()))
+     CPPUNIT_FAIL("Can't find medpartitioner, please set MEDCOUPLING_ROOT_DIR");
 -
    return execName;
  }