@@ -300,6 +300,8 @@ function(install_test_script TARGET_NAME)
300300 set(script "${script}XML_ARGS=\n")
301301 set(script "${script}if [ -n \"\$ARTIFACTS_DIR\" ]; then\n")
302302 set(script "${script} XML_ARGS=\"@XML_ARGS@\"\n")
303+ set(script "${script} mkdir -p \"@XML_DIR@\"\n")
304+ set(script "${script} touch \"@XML_FILE@\"\n")
303305 set(script "${script}fi\n")
304306 set(script "${script}\n")
305307 foreach(ONE_CMD ${TEST_COMMAND})
@@ -326,10 +328,15 @@ function(install_test_script TARGET_NAME)
326328
327329 # Now some replacements...
328330 # tests like to write xml output to our builddir; we don't need that, but we do want them in ARTIFACTS_DIR
329− string(REGEX MATCH \"( '--parameter')? '-o'( '--parameter')? '[^ ]*,xunitxml' \" xmlargs \"\${replacestr}\")
330− string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^ ]*,xunitxml' \" \" \\\$XML_ARGS \" replacestr \"\${replacestr}\")
331+ string(REGEX MATCH \"( '--parameter')? '-o'( '--parameter')? '[^']*,xunitxml' \" xmlargs \"\${replacestr}\")
332+ string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^']*,xunitxml' \" \" \\\$XML_ARGS \" replacestr \"\${replacestr}\")
331333 string(REGEX REPLACE \"${CMAKE_BINARY_DIR}\" \"\\\$ARTIFACTS_DIR\" xmlargs \"\${xmlargs}\")
334+ string(REGEX REPLACE \".*'([^']*),xunitxml'.*\" \"\\\\1\" xmlfile \"\${xmlargs}\")
335+ string(REGEX REPLACE \"(.*)/[^/]*\" \"\\\\1\" xmldir \"\${xmlfile}\")
336+ string(REGEX REPLACE \"'\" \"\" xmlargs \"\${xmlargs}\") # strip single quotes
332337 string(REGEX REPLACE \"@XML_ARGS@\" \"\${xmlargs}\" replacestr \"\${replacestr}\")
338+ string(REGEX REPLACE \"@XML_DIR@\" \"\${xmldir}\" replacestr \"\${replacestr}\")
339+ string(REGEX REPLACE \"@XML_FILE@\" \"\${xmlfile}\" replacestr \"\${replacestr}\")
333340 # replace build/source roots with their install paths
334341 string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
335342 string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")