As stated in my previous post, I have a script, named runTest.cmake, which 
works on linux but fails on Windows with:
     "The process cannot access the file because it is being used by another 
process"
This script calls execute_process() with an executable to capture the output 
for a comparison later. This script is invoked in a CMakeLists.txt file:
---------------------------------------------------------
...
MACRO (ADD_CMP_TEST resultfile resultcode)
    ADD_TEST (
        NAME TOOL-${resultfile}
        COMMAND "${CMAKE_COMMAND}"
            -D "TEST_PROGRAM=$<TARGET_FILE:tool>"
            -D "TEST_ARGS=${ARGN}"
            -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
            -D "TEST_OUTPUT=${resultfile}.out"
            -D "TEST_EXPECT=${resultcode}"
            -D "TEST_REFERENCE=${resultfile}.txt"
            -D "TEST_APPEND=EXIT CODE:"
            -P "runTest.cmake"
    )
  ENDMACRO (ADD_CMP_TEST file)

...

ADD_CMP_TEST (tool_11 1  tool_param1 tool_param2 tool_paramN)
---------------------------------------------------------------------------------
  
BTW, if I can run the command and args on the command line just fine.
I will consider any alternatives to the script even two ADD_TEST() calls. The 
primary need is to capture the output of the executable in a file.

Allen

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to