Add custom target to run tests

This target can depend on the individual test projects and this makes sure
that the test projects are build before running the tests.
This commit is contained in:
Vincent van Ravesteijn 2012-12-14 19:48:16 +01:00
parent bec9c1325e
commit 1b3871b302
4 changed files with 14 additions and 0 deletions

View File

@ -700,6 +700,17 @@ endif()
set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}") set(_lyx "${PACKAGE_BASE}${PROGRAM_SUFFIX}")
set(_tex2lyx tex2lyx${PROGRAM_SUFFIX}) set(_tex2lyx tex2lyx${PROGRAM_SUFFIX})
set (cmd ${CMAKE_CTEST_COMMAND})
if (MSVC)
set (cmd ${cmd} -C ${CMAKE_CFG_INTDIR})
else ()
set (cmd ${cmd} -C ${CMAKE_BUILD_TYPE})
endif ()
add_custom_target (lyx_run_tests COMMAND ${cmd})
set_target_properties(lyx_run_tests PROPERTIES FOLDER "tests")
add_subdirectory(src "${TOP_BINARY_DIR}/src") add_subdirectory(src "${TOP_BINARY_DIR}/src")
add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx") add_subdirectory(lib/lyx2lyx "${TOP_BINARY_DIR}/lyx2lyx")
add_subdirectory(lib/scripts "${TOP_BINARY_DIR}/scripts") add_subdirectory(lib/scripts "${TOP_BINARY_DIR}/scripts")

View File

@ -30,3 +30,4 @@ else()
endif() endif()
target_link_libraries(xvkbd ${XVFBDLIBS}) target_link_libraries(xvkbd ${XVFBDLIBS})
add_dependencies(lyx_run_tests xvkbd)

View File

@ -45,6 +45,7 @@ foreach(_src ${check_PROGRAMS})
-P "${TOP_SRC_DIR}/src/support/tests/supporttest.cmake") -P "${TOP_SRC_DIR}/src/support/tests/supporttest.cmake")
set_target_properties(${_src} PROPERTIES FOLDER "tests/support") set_target_properties(${_src} PROPERTIES FOLDER "tests/support")
add_dependencies(lyx_run_tests ${_src})
endforeach() endforeach()

View File

@ -25,4 +25,5 @@ foreach(_fl ${_tex_tests})
${fl}) ${fl})
endforeach() endforeach()
add_dependencies(lyx_run_tests ${_tex2lyx} ${_lyx})