Salome HOME
merge conflict
[tools/medcoupling.git] / src / INTERP_KERNELTest / TestInterpKernelUtils.cxx
index a814f2dc12d153da9b1edb0c39bed85267c4beb6..6aa73854a29f61700afca6dedac3f2d4e706f8dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "TestInterpKernelUtils.hxx"
 
 #include <cstdlib>
+#include <unistd.h>
 
 namespace INTERP_TEST
 {
   std::string getResourceFile( const std::string& filename )
   {
     std::string resourceFile = "";
-    
-    if ( getenv("top_srcdir") ) {
-      // we are in 'make test' step
-      resourceFile = getenv("top_srcdir");
-      resourceFile += "/resources/";
+
+    if ( getenv("MEDTOOL_ROOT_DIR") ) {
+      // use MEDTOOL_ROOT_DIR env.var
+      resourceFile = getenv("MEDTOOL_ROOT_DIR");
+      resourceFile += "/share/resources/med/";
     }
-    else if ( getenv("MED_ROOT_DIR") ) {
-      // use MED_ROOT_DIR env.var
-      resourceFile = getenv("MED_ROOT_DIR");
-      resourceFile += "/share/salome/resources/med/";
+    else {
+      resourceFile = get_current_dir_name();
+      resourceFile += "/../../resources/";
     }
+
     resourceFile += filename;
     return resourceFile;
   }