on xenial help sign in
Save xml test output in ADT_ARTIFACTS
ce11ca2Michael Terry
CMakeLists.txt−2
@@ -136,8 +136,6 @@ include_directories(
136 ${APPLICATION_API_INCLUDE_DIRS}
136 ${APPLICATION_API_INCLUDE_DIRS}
137)
137)
138
138
139−set(ARTIFACTS_DIR "" CACHE PATH "Store test artifacts in this directory.")
140−
141# Quiet logger
139# Quiet logger
142set(QUIET_LOGGER OFF CACHE BOOL "Disable test output on stdout.")
140set(QUIET_LOGGER OFF CACHE BOOL "Disable test output on stdout.")
143if(NOT QUIET_LOGGER)
141if(NOT QUIET_LOGGER)
cmake/modules/QmlTest.cmake+13−13
@@ -165,8 +165,7 @@ endfunction()
165#
165#
166# Logging options in the standard form of "-o filename,format"
166# Logging options in the standard form of "-o filename,format"
167# will be appended to the arguments list, prefixed with ARG_PREFIX.
167# will be appended to the arguments list, prefixed with ARG_PREFIX.
168−# XUnitXML files will be stored in current binary dir or under
168+# XUnitXML files will be stored in current binary dir.
169−# ARTIFACTS_DIR, if set.
170#
169#
171# Three targets will be created:
170# Three targets will be created:
172# - test${component_name} - Runs the test
171# - test${component_name} - Runs the test
@@ -179,14 +178,8 @@ function(add_executable_test COMPONENT_NAME TARGET)
179 cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
178 cmake_parse_arguments(QMLTEST "${QMLTEST_OPTIONS}" "${QMLTEST_SINGLE}" "${QMLTEST_MULTI}" ${ARGN})
180 mangle_arguments()
179 mangle_arguments()
181
180
182− if(ARTIFACTS_DIR)
181+ file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
183− file(RELATIVE_PATH path ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
184− file(MAKE_DIRECTORY ${ARTIFACTS_DIR}/${path})
185− set(file_logger -o ${ARTIFACTS_DIR}/${path}/test${COMPONENT_NAME}.xml,xunitxml)
186− else()
187− file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
188− set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
182+ set(file_logger -o ${CMAKE_CURRENT_BINARY_DIR}/test${COMPONENT_NAME}.xml,xunitxml)
189− endif()
190
183
191 bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
184 bake_arguments("${QMLTEST_ARG_PREFIX}" args ${iterations} ${file_logger} ${STDOUT_LOGGER})
192
185
@@ -304,10 +297,14 @@ function(install_test_script TARGET_NAME)
304 set(script "${script}export UNITY_TESTING_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}\"\n")
297 set(script "${script}export UNITY_TESTING_DATADIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}\"\n")
305 set(script "${script}export UNITY_TESTING_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\"\n")
298 set(script "${script}export UNITY_TESTING_LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\"\n")
306 set(script "${script}\n")
299 set(script "${script}\n")
300+ set(script "${script}XML_ARGS=\n")
301+ set(script "${script}if [ -n \"\$ARTIFACTS_DIR\" ]; then\n")
302+ set(script "${script} XML_ARGS=\"@XML_ARGS@\"\n")
303+ set(script "${script}fi\n")
304+ set(script "${script}\n")
307 foreach(ONE_CMD ${TEST_COMMAND})
305 foreach(ONE_CMD ${TEST_COMMAND})
308 set(script "${script}'${ONE_CMD}' ")
306 set(script "${script}'${ONE_CMD}' ")
309 endforeach()
307 endforeach()
310− set(script "${script}$@")
311
308
312 set(filename "${CMAKE_BINARY_DIR}/tests/scripts/${TARGET_NAME}.sh")
309 set(filename "${CMAKE_BINARY_DIR}/tests/scripts/${TARGET_NAME}.sh")
313
310
@@ -328,6 +325,11 @@ function(install_test_script TARGET_NAME)
328 file(READ \"${filename}\" replacestr)
325 file(READ \"${filename}\" replacestr)
329
326
330 # Now some replacements...
327 # Now some replacements...
328+ # 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 REPLACE \"${CMAKE_BINARY_DIR}\" \"\\\$ARTIFACTS_DIR\" xmlargs \"\${xmlargs}\")
332+ string(REGEX REPLACE \"@XML_ARGS@\" \"\${xmlargs}\" replacestr \"\${replacestr}\")
331 # replace build/source roots with their install paths
333 # replace build/source roots with their install paths
332 string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
334 string(REPLACE \"${CMAKE_BINARY_DIR}/libs\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_PRIVATE_LIBDIR}\" replacestr \"\${replacestr}\")
333 string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")
335 string(REPLACE \"${CMAKE_BINARY_DIR}/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}\" replacestr \"\${replacestr}\")
@@ -339,8 +341,6 @@ function(install_test_script TARGET_NAME)
339 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/utils/modules\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/utils\" replacestr \"\${replacestr}\")
341 string(REPLACE \"${CMAKE_BINARY_DIR}/tests/utils/modules\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_INSTALL_QML}/utils\" replacestr \"\${replacestr}\")
340 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/plugins\" replacestr \"\${replacestr}\")
342 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/plugins\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/plugins\" replacestr \"\${replacestr}\")
341 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
343 string(REPLACE \"${CMAKE_SOURCE_DIR}/tests/qmltests\" \"${CMAKE_INSTALL_PREFIX}/${SHELL_APP_DIR}/tests/qmltests\" replacestr \"\${replacestr}\")
342− # tests like to write xml output to our builddir; we don't need that
343− string(REGEX REPLACE \"( '--parameter')? '-o'( '--parameter')? '[^ ]*,xunitxml' \" \" \" replacestr \"\${replacestr}\")
344
344
345 file(WRITE \"${filename}\" \"\${replacestr}\")
345 file(WRITE \"${filename}\" \"\${replacestr}\")
346 ")
346 ")
debian/tests/qmluitests.sh+2
@@ -6,4 +6,6 @@ set -xe
6
6
7DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
7DEB_HOST_MULTIARCH=$(dpkg-architecture -qDEB_HOST_MULTIARCH)
8
8
9+export ARTIFACTS_DIR="${ADT_ARTIFACTS}"
10+
9/usr/lib/$DEB_HOST_MULTIARCH/unity8/tests/scripts/xvfballtests.sh
11/usr/lib/$DEB_HOST_MULTIARCH/unity8/tests/scripts/xvfballtests.sh