X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FTools%2Fpadder%2Fmeshjob%2Fimpl%2Ftesthelper.hxx;fp=src%2FTools%2Fpadder%2Fmeshjob%2Fimpl%2Ftesthelper.hxx;h=adc7fdf29b5ff04c1ca48ca00aebdbc3369c4965;hp=0000000000000000000000000000000000000000;hb=bd4e115a78b52e3fbc016e5e30bb0e19b2a9e7d6;hpb=0635c9fc80f67d1e5dc0e94ec85f487286a92070 diff --git a/src/Tools/padder/meshjob/impl/testhelper.hxx b/src/Tools/padder/meshjob/impl/testhelper.hxx new file mode 100644 index 000000000..adc7fdf29 --- /dev/null +++ b/src/Tools/padder/meshjob/impl/testhelper.hxx @@ -0,0 +1,66 @@ +// Copyright (C) 2011-2012 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// Authors : Guillaume Boulant (EDF) - 01/03/2011 + +#ifndef __TESTHELPER_HXX__ +#define __TESTHELPER_HXX__ + +// >>> +// WARN: this file is DEPRECATED and/or should be used for test +// purpose only. The PADDER configuration is now read in a +// configuration file (padder.cfg). +// <<< + +#include // Standard C include (for getenv) +#include +#include + +/*! + * This function returns the module SMESH installation root directory + * as a string. + */ +static std::string SMESH_ROOT_DIR() { + static std::string * smesh_root_dir; + if ( smesh_root_dir == NULL ) { + char * SMESH_ROOT_DIR = getenv("SMESH_ROOT_DIR"); + if ( SMESH_ROOT_DIR == NULL ) { + smesh_root_dir = new std::string(""); + } + else { + smesh_root_dir = new std::string(SMESH_ROOT_DIR); + } + } + return *smesh_root_dir; +} + +/*! Relative path of the directory containing data and exe for tests */ +static std::string PADDEREXE_RPATH("/share/salome/resources/smesh/padderexe"); +/*! Absolute path of the directory containing data and exe for tests */ +static std::string PADDEREXE_APATH(SMESH_ROOT_DIR()+PADDEREXE_RPATH); +/*! Absolute path of the exe shell script for tests */ +static std::string PADDEREXE_SCRIPT_FILENAME(PADDEREXE_APATH+"/padder.sh"); + + +static int testssh_using_system() { + const char * cmd = "/usr/bin/ssh claui2p1 -l boulant 'cd /tmp && ./runCommand_padder_Mon_Feb_28_14_28_36_2011.sh'"; + int result = system(cmd); + return result; +} + +#endif // __TESTHELPER_HXX__