Salome HOME
Remove the use of getlogin.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Wed, 25 Nov 2020 10:38:37 +0000 (11:38 +0100)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Wed, 25 Nov 2020 10:38:37 +0000 (11:38 +0100)
src/engine/Test/CMakeLists.txt
src/engine/Test/engineTest.cxx

index 6a13ad4d6d4e2edd24f95623726fe57bbbebedc1..345bad5897517bcfdca6f26845f4c66d1a9bce9e 100644 (file)
@@ -33,6 +33,7 @@ SET(_link_LIBRARIES
   ${PTHREAD_LIBRARIES}
   YACSlibEngine 
   YACSBases
+  SALOMEBasics
 )
 
 # additional preprocessor / compiler flags
@@ -84,4 +85,4 @@ INSTALL(TARGETS TestEngine DESTINATION ${LOCAL_TEST_DIR})
 INSTALL(TARGETS IntegrationTestEngine DESTINATION ${LOCAL_TEST_DIR})
 INSTALL(FILES CTestTestfileInstall.cmake
         DESTINATION ${LOCAL_TEST_DIR}
-        RENAME CTestTestfile.cmake)
\ No newline at end of file
+        RENAME CTestTestfile.cmake)
index 7699854e26db5f2ab72e7f68e42a3f6421070dcf..a305c64db319fd38f800dbff7b156966f1508447 100644 (file)
 #include <list>
 #include <vector>
 #include <string.h>
-#ifdef WIN32
-#include <stdlib.h>
-#else
-#include <unistd.h>
-#endif
+#include "Basics_DirUtils.hxx"
 
 //#define _DEVDEBUG_
 #include "YacsTrace.hxx"
@@ -1005,16 +1001,8 @@ void EngineTest::RecursiveBlocs_multipleRecursion()
         DEBTRACE("     output port name for graphe = " << _nodeMap["graphe"]->getOutPortName(*it));
       }
     YACS::ENGINE::VisitorSaveState vst(_compoMap["graphe"]);
-#ifdef WIN32
-      std::string logDir=getenv("SALOME_TMP_DIR");
-      logDir += "\\";
-#else
-    std::string logDir = std::string("/tmp/")+ getlogin();
-    std::string cmd = "mkdir -p " + logDir;
-    system( cmd.c_str() );
-       logDir += "/";
-#endif
-    vst.openFileDump(logDir + std::string("RecursiveBlocs_multipleRecursion_dumpState.xml"));
+    std::string dumpFilePath = Kernel_Utils::GetTmpDir() + "RecursiveBlocs.xml";
+    vst.openFileDump(dumpFilePath);
     _compoMap["graphe"]->accept(&vst);
     vst.closeFileDump();
   }