Salome HOME
Merge branch 'abn/tests_from_build'
[tools/medcoupling.git] / src / MEDPartitioner / Test / MEDPARTITIONERTest.cxx
index 30c3a863eaa987cc1004815c1bcc3fdb43b2494d..b25af62b83fe967ada34c9d182c2f033cc476c04 100644 (file)
@@ -94,14 +94,14 @@ std::string MEDPARTITIONERTest::getPartitionerExe() const
     {
       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 = 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;
 }