summaryrefslogtreecommitdiffstats
path: root/tests/CMakeLists.txt
blob: 904d1069488e90ee8d0a51883979c4436c66e052 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
if(NOT CTEST_TESTING_TIMEOUT)
    set(CTEST_TESTING_TIMEOUT 60)
endif()

macro(TEST_QT_MODULE var name)
  if(NOT DISABLE_${name} AND ${var})
      add_subdirectory(${name})
  endif()
endmacro(TEST_QT_MODULE)

macro(PYSIDE_TEST)
    string(REGEX MATCH "/([^/]+)//?([^/]+)\\.py" foo "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}" )
    set(TEST_NAME "${CMAKE_MATCH_1}_${CMAKE_MATCH_2}")
    if (${ARGC} EQUAL 1)
        set(EXPECT_TO_FAIL 0)
    elseif(${ARGC} EQUAL 2)
        set(EXPECT_TO_FAIL ${ARGV1})
    else()
        message(WARNING "Ivalid call of macro PYSIDE_TEST")
    endif()
    set(TEST_CMD ${CMAKE_SOURCE_DIR}/tests/run_test.sh  ${libpyside_BINARY_DIR} "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util" ${PYTHON_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}")
    add_test(${TEST_NAME} ${TEST_CMD})
    set_tests_properties(${TEST_NAME} PROPERTIES
                         TIMEOUT ${CTEST_TESTING_TIMEOUT}
                         WILL_FAIL ${EXPECT_TO_FAIL})
endmacro(PYSIDE_TEST)

# Try to find QtMultimedia
# TODO: Remove this hack when cmake support QtMultimedia module
if (NOT QT_QTMULTIMEDIA_FOUND AND ${QTVERSION} VERSION_GREATER 4.5.9)
    find_path(QT_QTMULTIMEDIA_INCLUDE_DIR QtMultimedia
            PATHS ${QT_HEADERS_DIR}/QtMultimedia
                ${QT_LIBRARY_DIR}/QtMultimedia.framework/Headers
            NO_DEFAULT_PATH)
    find_library(QT_QTMULTIMEDIA_LIBRARY QtMultimedia PATHS ${QT_LIBRARY_DIR} NO_DEFAULT_PATH)
    if (QT_QTMULTIMEDIA_INCLUDE_DIR AND QT_QTMULTIMEDIA_LIBRARY)
        set(QT_QTMULTIMEDIA_FOUND ON)
    endif()
endif ()

add_subdirectory(signals)
TEST_QT_MODULE(QT_QTCORE_FOUND QtCore)
TEST_QT_MODULE(QT_QTGUI_FOUND QtGui)
TEST_QT_MODULE(QT_QTNETWORK_FOUND QtNetwork)
TEST_QT_MODULE(QT_QTWEBKIT_FOUND QtWebKit)
TEST_QT_MODULE(QT_QTSVG_FOUND QtSvg)
TEST_QT_MODULE(QT_QTXML_FOUND QtXml)
TEST_QT_MODULE(QT_QTTEST_FOUND QtTest)
TEST_QT_MODULE(QT_QTOPENGL_FOUND QtOpenGL)
TEST_QT_MODULE(QT_QTSQL_FOUND QtSql)
TEST_QT_MODULE(QT_QTUITOOLS_FOUND QtUiTools)
TEST_QT_MODULE(QT_QTHELP_FOUND QtHelp)
TEST_QT_MODULE(QT_QTXMLPATTERNS_FOUND QtXmlPatterns)
TEST_QT_MODULE(QT_QTMAEMO5_FOUND QtMaemo5)
TEST_QT_MODULE(QT_QTSCRIPT_FOUND QtScript)
TEST_QT_MODULE(QT_QTSCRIPTTOOLS_FOUND QtScriptTools)
TEST_QT_MODULE(QT_QTMULTIMEDIA_FOUND QtMultimedia)
TEST_QT_MODULE(QT_PHONON_FOUND phonon)
TEST_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)