~ci-train-bot/ubuntu-settings-components/ubuntu-settings-components-ubuntu-zesty-2106

« back to all changes in this revision

Viewing changes to tests/CMakeLists.txt

  • Committer: Michał Sawicz
  • Date: 2016-08-17 15:05:26 UTC
  • mto: This revision was merged to the branch mainline in revision 161.
  • Revision ID: michal.sawicz@canonical.com-20160817150526-j8d3ig4c18xm20d4
Fix up import paths and environment

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 
13
13
add_subdirectory(utils)
14
14
 
 
15
set(USC_PLUGINPATH "${CMAKE_BINARY_DIR}/plugins" CACHE PATH "Path to pre-built u-s-c plugin dir.")
 
16
 
 
17
set(USC_IMPORT_PATHS
 
18
    ${CMAKE_BINARY_DIR}/tests/qmltests/mocks
 
19
    ${CMAKE_BINARY_DIR}/tests/utils/modules
 
20
    ${USC_PLUGINPATH}
 
21
)
 
22
 
 
23
macro(usc_parse_arguments)
 
24
    cmake_parse_arguments(USCTEST
 
25
        "${QMLTEST_OPTIONS}"
 
26
        "${QMLTEST_SINGLE}"
 
27
        "${QMLTEST_MULTI}"
 
28
        ${ARGN}
 
29
    )
 
30
 
 
31
    set(environment
 
32
        UNITY_TESTING=1
 
33
        LANGUAGE=C
 
34
        LC_ALL=C.UTF-8
 
35
    )
 
36
endmacro()
 
37
 
15
38
# add a graphical qml test
16
39
# see QmlTest.cmake for additional options
17
40
function(add_usc_qmltest PATH COMPONENT_NAME)
 
41
    usc_parse_arguments(${ARGN})
18
42
    add_qml_test(${PATH} ${COMPONENT_NAME}
19
43
        DEPENDS UbuntuTest
20
 
        IMPORT_PATHS ${CMAKE_BINARY_DIR}/plugins ${CMAKE_BINARY_DIR}/tests/utils/modules
 
44
        IMPORT_PATHS ${USC_IMPORT_PATHS}
21
45
        TARGETS uitests
22
46
        ${ARGN}
 
47
        ENVIRONMENT ${environment}
 
48
                    ${USCTEST_ENVIRONMENT}
23
49
    )
24
50
endfunction()
25
51