]> SALOME platform Git repositories - modules/kernel.git/blobdiff - src/Launcher/BatchTest.cxx
Salome HOME
Compilation under Windows: add missing header
[modules/kernel.git] / src / Launcher / BatchTest.cxx
index 788aca8b5a6c7c08df1e47f435be34d08e7b00a6..624d3d672b4a2162e1beeacfd8559d742b19d70c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -22,6 +22,8 @@
 
 #include "BatchTest.hxx"
 #include "Launcher.hxx"
+#include "Basics_Utils.hxx"
+#include "Basics_DirUtils.hxx"
 
 #ifdef WITH_LIBBATCH
 #include <libbatch/MpiImpl.hxx>
@@ -47,10 +49,8 @@ BatchTest::BatchTest(const Engines::ResourceDefinition& batch_descr)
   strftime(date, BUFSIZE, "%Y_%m_%d__%H_%M_%S", localtime(&curtime));
 
   // Creating test temporary file
-  _test_filename =  "/tmp/";
-  _test_filename += std::string(date) + "_test_cluster_file_";
-  _test_filename += _batch_descr.hostname.in();
   _base_filename = std::string(date) + "_test_cluster_file_" + _batch_descr.hostname.in();
+  _test_filename = Kernel_Utils::GetTmpDir() + _base_filename;
 #endif
 }
 
@@ -172,13 +172,13 @@ BatchTest::test_filecopy()
     return result;
   }
 
-  // Writing into the tempory file
+  // Writing into the temporary file
   command = "echo Hello > " +  _test_filename;
   status = system(command.c_str());
   if(status) {
     std::ostringstream oss;
     oss << status;
-    result += "Error in creating tempory file ! status = ";
+    result += "Error in creating temporary file ! status = ";
     result += oss.str();
     return result;
   }
@@ -435,7 +435,7 @@ BatchTest::test_jobsubmit_simple()
   file_normal.close();
   if (normal_input != "Bonjour")
   {
-    result += "error from simple ouput file ! waiting for Bonjour and get : " + normal_input;
+    result += "error from simple output file ! waiting for Bonjour and get : " + normal_input;
     return result;
   }
   std::string error_input;
@@ -663,7 +663,7 @@ BatchTest::test_jobsubmit_mpi()
   file_normal.close();
   if (!test_ok)
   {
-    result += "error from mpi ouput file ! waiting for HELLO MPI please watch /tmp/" + _date + "_mpi_output.log file";
+    result += "error from mpi output file ! waiting for HELLO MPI please watch /tmp/" + _date + "_mpi_output.log file";
     return result;
   }
   result = "OK";