~ps-jenkins/unity-scopes-shell/ubuntu-rtm-14.09-proposed

« back to all changes in this revision

Viewing changes to tests/CMakeLists.txt

  • Committer: Michal Hruby
  • Date: 2013-11-07 17:48:16 UTC
  • Revision ID: michal.mhr@gmail.com-20131107174816-w1vqq6juarrawx23
Initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
pkg_check_modules(UNITYCORE REQUIRED unity-core-6.0>=7.1.1)
 
2
pkg_check_modules(LIBUNITYPROTO REQUIRED unity-protocol-private)
 
3
pkg_check_modules(LIBUNITY REQUIRED unity)
 
4
pkg_check_modules(LIBSIGCPP REQUIRED sigc++-2.0)
 
5
pkg_check_modules(QTDEE REQUIRED libdee-qt5>=3.2)
 
6
 
 
7
include_directories(
 
8
    ${Unity-qml_SOURCE_DIR}
 
9
    ${CMAKE_CURRENT_SOURCE_DIR}/../src
 
10
    ${CMAKE_CURRENT_BINARY_DIR}
 
11
    ${LIBUNITYPROTO_INCLUDE_DIRS}
 
12
    ${LIBUNITY_INCLUDE_DIRS}
 
13
    ${LIBSIGCPP_INCLUDE_DIRS}
 
14
    ${UNITYCORE_INCLUDE_DIRS}
 
15
    ${QTDEE_INCLUDE_DIRS}
 
16
    )
 
17
 
 
18
macro(run_tests)
 
19
    set(_test_list "")
 
20
    foreach(_test ${ARGN})
 
21
        set(testCommand
 
22
                ${CMAKE_CURRENT_BINARY_DIR}/${_test}Exec
 
23
                -o ${CMAKE_BINARY_DIR}/${_test}.xml,xunitxml
 
24
                -o -,txt)
 
25
        add_test(NAME test${CLASSNAME}${_test} COMMAND ${testCommand})
 
26
        add_custom_target(${_test} ${testCommand})
 
27
        add_executable(${_test}Exec ${_test}.cpp)
 
28
        qt5_use_modules(${_test}Exec Test Core Qml)
 
29
        set_tests_properties(test${CLASSNAME}${_test}
 
30
                PROPERTIES ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_BINARY_DIR}/plugins/Unity:${LIBUNITYPROTO_LIBRARY_DIRS}")
 
31
 
 
32
        target_link_libraries(${_test}Exec
 
33
            Unity-qml
 
34
            ${UNITYCORE_LDFLAGS}
 
35
            ${LIBUNITY_LDFLAGS}
 
36
            ${LIBUNITYPROTO_LDFLAGS}
 
37
            ${LIBSIGCPP_LDFLAGS}
 
38
            ${QTDEE_LDFLAGS}
 
39
            )
 
40
 
 
41
        set(_test_list "${_test_list};${_test}")
 
42
    endforeach()
 
43
endmacro(run_tests)
 
44
 
 
45
run_tests(
 
46
    signalslisttest
 
47
    previewbindingstest
 
48
    filtersbindingstest
 
49
    resultstest
 
50
    )