<commit_before>if(CMAKE_VERSION VERSION_LESS 2.8)
    message("CMake version greater than 2.8 necessary to run tests")
else()
    if(NOT CTEST_TESTING_TIMEOUT)
        set(CTEST_TESTING_TIMEOUT 60)
    endif()

   if(WIN32)
        set(TEST_PYTHONPATH     "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${pysidetest_BINARY_DIR};$ENV{PYTHONPATH}")
        set(TEST_LIBRARY_PATH   "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_INCLUDE_DIR}/../../bin;$ENV{PATH}")
        set(LIBRARY_PATH_VAR    "PATH")
        string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
        string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")

        string(REPLACE ";" "\\;" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
        string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
    else()
        set(TEST_PYTHONPATH     "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util:${pysidetest_BINARY_DIR}:$ENV{PYTHONPATH}")
        set(TEST_LIBRARY_PATH   "${libpyside_BINARY_DIR}:${pysidetest_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
        set(LIBRARY_PATH_VAR    "LD_LIBRARY_PATH")
    endif()


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

    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 "Invalid call of macro PYSIDE_TEST")
        endif()
        set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${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}
                             ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}")
    endmacro()

    add_subdirectory(pysidetest)
    add_subdirectory(signals)
    # XXX we should add some tests, here!
    TEST_QT_MODULE(Qt5Core_FOUND QtCore)
    #TEST_QT_MODULE(Qt5Concurrent_FOUND QtConcurrect)
    TEST_QT_MODULE(Qt5Gui_FOUND QtGui)
    TEST_QT_MODULE(Qt5Widgets_FOUND QtWidgets)
    #TEST_QT_MODULE(Qt5PrintSupport_FOUND QtPrintSupport)
    TEST_QT_MODULE(Qt5Network_FOUND QtNetwork)
    TEST_QT_MODULE(Qt5WebKit_FOUND QtWebKit)
    TEST_QT_MODULE(Qt5WebKitWidgets_FOUND QtWebKitWidgets)
    TEST_QT_MODULE(Qt5Xml_FOUND QtXml)
    TEST_QT_MODULE(Qt5XmlPatterns_FOUND QtXmlPatterns)
    TEST_QT_MODULE(Qt5Svg_FOUND QtSvg)
    TEST_QT_MODULE(Qt5Test_FOUND QtTest)
    TEST_QT_MODULE(Qt5Sql_FOUND QtSql)
    #TEST_QT_MODULE(Qt5Designer_FOUND QtDesigner)
    TEST_QT_MODULE(Qt5OpenGL_FOUND QtOpenGL)
    TEST_QT_MODULE(Qt5UiTools_FOUND QtUiTools)
    TEST_QT_MODULE(Qt5Help_FOUND QtHelp)
    TEST_QT_MODULE(Qt5Script_FOUND QtScript)
    TEST_QT_MODULE(Qt5ScriptTools_FOUND QtScriptTools)
    TEST_QT_MODULE(Qt5Multimedia_FOUND QtMultimedia)
    TEST_QT_MODULE(Qt5Qml_FOUND QtQml)
    #TEST_QT_MODULE(Qt5Quick_FOUND QtQuick)
    #TEST_QT_MODULE(Qt5QuickWidgets_FOUND QtQuickWidgets)
    #TEST_QT_MODULE(Qt5WebChannel_FOUND QtWebChannel)
    #TEST_QT_MODULE(Qt5WebEngine_FOUND QtWebEngine)
    #TEST_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets)
    #TEST_QT_MODULE(Qt5WebSockets_FOUND QtWebSockets)

    if(UNIX AND NOT APPLE)
        #TEST_QT_MODULE(Qt5X11Extras_FOUND QtX11Extras) # new in Qt5, from QtGui
    endif()
<commit_msg>Fix a bug in QtWebKitWidgets<commit_after>if(CMAKE_VERSION VERSION_LESS 2.8)
    message("CMake version greater than 2.8 necessary to run tests")
else()
    if(NOT CTEST_TESTING_TIMEOUT)
        set(CTEST_TESTING_TIMEOUT 60)
    endif()

   if(WIN32)
        set(TEST_PYTHONPATH     "${CMAKE_BINARY_DIR};${CMAKE_SOURCE_DIR}/tests/util;${pysidetest_BINARY_DIR};$ENV{PYTHONPATH}")
        set(TEST_LIBRARY_PATH   "${libpyside_BINARY_DIR};${pysidetest_BINARY_DIR};${SHIBOKEN_INCLUDE_DIR}/../../bin;$ENV{PATH}")
        set(LIBRARY_PATH_VAR    "PATH")
        string(REPLACE "\\" "/" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
        string(REPLACE "\\" "/" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")

        string(REPLACE ";" "\\;" TEST_PYTHONPATH "${TEST_PYTHONPATH}")
        string(REPLACE ";" "\\;" TEST_LIBRARY_PATH "${TEST_LIBRARY_PATH}")
    else()
        set(TEST_PYTHONPATH     "${CMAKE_BINARY_DIR}:${CMAKE_SOURCE_DIR}/tests/util:${pysidetest_BINARY_DIR}:$ENV{PYTHONPATH}")
        set(TEST_LIBRARY_PATH   "${libpyside_BINARY_DIR}:${pysidetest_BINARY_DIR}:$ENV{LD_LIBRARY_PATH}")
        set(LIBRARY_PATH_VAR    "LD_LIBRARY_PATH")
    endif()


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

    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 "Invalid call of macro PYSIDE_TEST")
        endif()
        set(TEST_CMD ${XVFB_EXEC} ${SHIBOKEN_PYTHON_INTERPRETER} "${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}
                             ENVIRONMENT "PYTHONPATH=${TEST_PYTHONPATH};${LIBRARY_PATH_VAR}=${TEST_LIBRARY_PATH}")
    endmacro()

    add_subdirectory(pysidetest)
    add_subdirectory(signals)
    # XXX we should add some tests, here!
    TEST_QT_MODULE(Qt5Core_FOUND QtCore)
    #TEST_QT_MODULE(Qt5Concurrent_FOUND QtConcurrect)
    TEST_QT_MODULE(Qt5Gui_FOUND QtGui)
    TEST_QT_MODULE(Qt5Widgets_FOUND QtWidgets)
    #TEST_QT_MODULE(Qt5PrintSupport_FOUND QtPrintSupport)
    TEST_QT_MODULE(Qt5Network_FOUND QtNetwork)
    TEST_QT_MODULE(Qt5WebKit_FOUND QtWebKit)
    #TEST_QT_MODULE(Qt5WebKitWidgets_FOUND QtWebKitWidgets)
    TEST_QT_MODULE(Qt5Xml_FOUND QtXml)
    TEST_QT_MODULE(Qt5XmlPatterns_FOUND QtXmlPatterns)
    TEST_QT_MODULE(Qt5Svg_FOUND QtSvg)
    TEST_QT_MODULE(Qt5Test_FOUND QtTest)
    TEST_QT_MODULE(Qt5Sql_FOUND QtSql)
    #TEST_QT_MODULE(Qt5Designer_FOUND QtDesigner)
    TEST_QT_MODULE(Qt5OpenGL_FOUND QtOpenGL)
    TEST_QT_MODULE(Qt5UiTools_FOUND QtUiTools)
    TEST_QT_MODULE(Qt5Help_FOUND QtHelp)
    TEST_QT_MODULE(Qt5Script_FOUND QtScript)
    TEST_QT_MODULE(Qt5ScriptTools_FOUND QtScriptTools)
    TEST_QT_MODULE(Qt5Multimedia_FOUND QtMultimedia)
    TEST_QT_MODULE(Qt5Qml_FOUND QtQml)
    #TEST_QT_MODULE(Qt5Quick_FOUND QtQuick)
    #TEST_QT_MODULE(Qt5QuickWidgets_FOUND QtQuickWidgets)
    #TEST_QT_MODULE(Qt5WebChannel_FOUND QtWebChannel)
    #TEST_QT_MODULE(Qt5WebEngine_FOUND QtWebEngine)
    #TEST_QT_MODULE(Qt5WebEngineWidgets_FOUND QtWebEngineWidgets)
    #TEST_QT_MODULE(Qt5WebSockets_FOUND QtWebSockets)

    if(UNIX AND NOT APPLE)
        #TEST_QT_MODULE(Qt5X11Extras_FOUND QtX11Extras) # new in Qt5, from QtGui
    endif()

{'fraction_non_alphanumeric': 0.10750203859744496, 'fraction_numerical': 0.01331883664039141, 'mean_word_length': 4.085694540428473, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2318046', 'n_tokens_mistral': 2902, 'n_tokens_neox': 2775, 'n_words': 348}