1 // Copyright (C) 2011-2015 EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 // Authors : Guillaume Boulant (EDF) - 01/03/2011
22 #ifndef __TESTHELPER_HXX__
23 #define __TESTHELPER_HXX__
26 // WARN: this file is DEPRECATED and/or should be used for test
27 // purpose only. The PADDER configuration is now read in a
28 // configuration file (padder.cfg).
31 #include <stdlib.h> // Standard C include (for getenv)
36 * This function returns the module SMESH installation root directory
39 static std::string SMESH_ROOT_DIR() {
40 static std::string * smesh_root_dir;
41 if ( smesh_root_dir == NULL ) {
42 char * SMESH_ROOT_DIR = getenv("SMESH_ROOT_DIR");
43 if ( SMESH_ROOT_DIR == NULL ) {
44 smesh_root_dir = new std::string("<path_undefined>");
47 smesh_root_dir = new std::string(SMESH_ROOT_DIR);
50 return *smesh_root_dir;
53 /*! Relative path of the directory containing data and exe for tests */
54 static std::string PADDEREXE_RPATH("/share/salome/resources/smesh/padderexe");
55 /*! Absolute path of the directory containing data and exe for tests */
56 static std::string PADDEREXE_APATH(SMESH_ROOT_DIR()+PADDEREXE_RPATH);
57 /*! Absolute path of the exe shell script for tests */
58 static std::string PADDEREXE_SCRIPT_FILENAME(PADDEREXE_APATH+"/padder.sh");
61 static int testssh_using_system() {
62 const char * cmd = "/usr/bin/ssh claui2p1 -l boulant 'cd /tmp && ./runCommand_padder_Mon_Feb_28_14_28_36_2011.sh'";
63 int result = system(cmd);
67 #endif // __TESTHELPER_HXX__