From 426f5da5d6ffe74e7d1c54c7321bb653d2c98ad1 Mon Sep 17 00:00:00 2001 From: Margarita KARPUNINA Date: Thu, 1 Dec 2022 11:37:46 +0300 Subject: [PATCH] [bos #32518][EDF] (2022-T3) Parametrize commands in LIBBATCH Additional debug of LIBBATCH tests on Windows --- src/Core/Test/Test_BatchManager.cxx | 8 +++++++- src/Local/BatchManager_Local.cxx | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) 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()); -- 2.39.2