Salome HOME
Integration of the PADDER algorithm as a simple SALOME plugin.
[modules/smesh.git] / src / Tools / padder / meshjob / impl / testhelper.hxx
1 #ifndef __TESTHELPER_HXX__
2 #define __TESTHELPER_HXX__
3
4 #include <stdlib.h> // Standard C include (for getenv)
5 #include <unistd.h>
6 #include <string>
7
8 /*!
9  * This function returns the module SPADDER installation root
10  * directory as a string.
11  */
12 static std::string SPADDER_ROOT_DIR() {
13   static std::string * spadder_root_dir;
14   if ( spadder_root_dir == NULL ) {
15     char * SPADDER_ROOT_DIR = getenv("SPADDER_ROOT_DIR");
16     spadder_root_dir = new std::string(SPADDER_ROOT_DIR);
17   }
18   return *spadder_root_dir;
19 }
20
21 /*! Relative path of the directory containing data and exe for tests */
22 static std::string PADDEREXE_RPATH("/share/salome/resources/spadder/padderexe");
23 /*! Absolute path of the directory containing data and exe for tests */
24 static std::string PADDEREXE_APATH(SPADDER_ROOT_DIR()+PADDEREXE_RPATH);
25 /*! Absolute path of the exe shell script for tests */
26 static std::string PADDEREXE_SCRIPT_FILENAME(PADDEREXE_APATH+"/padder.sh");
27
28
29 static int testssh_using_system() {
30   const char * cmd = "/usr/bin/ssh claui2p1 -l boulant 'cd /tmp && ./runCommand_padder_Mon_Feb_28_14_28_36_2011.sh'";
31   int result = system(cmd);
32   return result;
33 }
34
35 #endif // __TESTHELPER_HXX__