X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEMTest%2FParaMEDMEMTest.cxx;h=dab88ab1d5437f6b6e6f88b271ede3b3e547ff5e;hb=56e7b97b6270ad0b2d523070f937e0b8ebae0d30;hp=128c04049aa56ed342d71b04d50befa274f7b4c3;hpb=8763c12d01e33d6845dd53be65b001514d00bd42;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEMTest/ParaMEDMEMTest.cxx b/src/ParaMEDMEMTest/ParaMEDMEMTest.cxx index 128c04049..dab88ab1d 100644 --- a/src/ParaMEDMEMTest/ParaMEDMEMTest.cxx +++ b/src/ParaMEDMEMTest/ParaMEDMEMTest.cxx @@ -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 @@ -30,32 +30,20 @@ #include #endif -//================================================================================ -/*! - * \brief Get path to the resources file. - * - * When running 'make test' source file is taken from MED_SRC/resources folder. - * Otherwise, file is searched in ${MED_ROOT_DIR}/share/salome/resources/med folder. - * - * \param filename name of the resource file (should not include a path) - * \return full path to the resource file - */ -//================================================================================ - std::string ParaMEDMEMTest::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("MEDCOUPLING_ROOT_DIR") ) { + // use MEDCOUPLING_ROOT_DIR env.var + resourceFile = getenv("MEDCOUPLING_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; } @@ -92,7 +80,7 @@ std::string ParaMEDMEMTest::getTmpDirectory() //================================================================================ /*! - * \brief Creates a copy of source file (if source file is specified) + * \brief Creates a copy of source file (if source file is specified) * in the temporary directory and returns a path to the tmp file * * \param tmpfile name of the temporary file (without path)