From: Margarita KARPUNINA Date: Thu, 1 Dec 2022 08:37:46 +0000 (+0300) Subject: [bos #32518][EDF] (2022-T3) X-Git-Tag: V2_5_0~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=426f5da5d6ffe74e7d1c54c7321bb653d2c98ad1;p=tools%2Flibbatch.git [bos #32518][EDF] (2022-T3) Parametrize commands in LIBBATCH Additional debug of LIBBATCH tests on Windows --- diff --git a/src/Core/Test/Test_BatchManager.cxx b/src/Core/Test/Test_BatchManager.cxx index 98de67c..f048626 100644 --- a/src/Core/Test/Test_BatchManager.cxx +++ b/src/Core/Test/Test_BatchManager.cxx @@ -102,11 +102,17 @@ int main(int argc, char** argv) const string & user = parser.getTestValue(bmType, protocolStr, "USER"); int timeout = parser.getTestValueAsInt(bmType, protocolStr, "TIMEOUT"); +#ifdef WIN32 + const char separator = '\\'; +#else + const char separator = '/'; +#endif + // Define the job... Job job; // ... and its parameters ... Parametre p; - p[EXECUTABLE] = string(CMAKE_CURRENT_SOURCE_DIR) + "/test_script.py"; + p[EXECUTABLE] = string(CMAKE_CURRENT_SOURCE_DIR) + separator + "test_script.py"; p[ARGUMENTS] = "copied_seta.py"; p[ARGUMENTS] += "copied_setb.py"; p[ARGUMENTS] += "orig_result.txt"; diff --git a/src/Local/BatchManager_Local.cxx b/src/Local/BatchManager_Local.cxx index 0710428..0ce2242 100644 --- a/src/Local/BatchManager_Local.cxx +++ b/src/Local/BatchManager_Local.cxx @@ -749,6 +749,7 @@ namespace Batch { Parametre param = _job.getParametre(); Parametre::iterator it; PROCESS_INFORMATION pi; + ZeroMemory( &pi, sizeof(pi) ); try { @@ -770,7 +771,6 @@ namespace Batch { STARTUPINFO si; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); - ZeroMemory( &pi, sizeof(pi) ); // Copy the command to a non-const buffer char * buffer = strdup(comstr.c_str());