From: abn Date: Mon, 4 Jan 2016 11:36:25 +0000 (+0100) Subject: Merge branch 'abn/tests_from_build' X-Git-Tag: V7_8_0a1~12 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c6847bfb1eba9336d97c0f8d3ceed51e0a9f44ea;p=tools%2Fmedcoupling.git Merge branch 'abn/tests_from_build' Conflicts: src/INTERP_KERNELTest/TestInterpKernelUtils.cxx src/MEDLoader/Test/MEDLoaderTest.cxx src/MEDLoader/Test/SauvLoaderTest.cxx src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx --- c6847bfb1eba9336d97c0f8d3ceed51e0a9f44ea diff --cc src/INTERP_KERNELTest/TestInterpKernelUtils.cxx index 5adeb43fc,2275c57b0..25b1c1154 --- a/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx +++ b/src/INTERP_KERNELTest/TestInterpKernelUtils.cxx @@@ -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 -#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_ diff --cc src/MEDLoader/Test/SauvLoaderTest.cxx index 1674cffec,66fbcda6b..a7bdb44fb --- a/src/MEDLoader/Test/SauvLoaderTest.cxx +++ b/src/MEDLoader/Test/SauvLoaderTest.cxx @@@ -24,11 -24,10 +24,10 @@@ #include "MEDFileData.hxx" #include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingMemArray.hxx" + #include "TestInterpKernelUtils.hxx" // getResourceFile() #ifdef WIN32 -# include +#include - #include - #define getcwd _getcwd #else # include #endif diff --cc src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx index 30c3a863e,505d48366..b25af62b8 --- a/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx +++ b/src/MEDPartitioner/Test/MEDPARTITIONERTest.cxx @@@ -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; }