Merge integration refs/builds/qtci/dev/1617813097
This commit is contained in:
commit
b187ce87f9
@ -113,44 +113,95 @@ function(_qt_internal_set_up_test_run_environment testname)
|
||||
|
||||
endfunction()
|
||||
|
||||
# Checks if the test project can be built successfully.
|
||||
# Checks if the test project can be built successfully. Arguments:
|
||||
#
|
||||
# SIMULATE_IN_SOURCE: If the option is specified, the function copies sources of the tests to the
|
||||
# CMAKE_CURRENT_BINARY_DIR directory, creates internal build directory in the
|
||||
# copied sources and uses this directory to build and test the project.
|
||||
# This makes possible to have relative paths to the source files in the
|
||||
# generated ninja rules.
|
||||
#
|
||||
# BINARY: Path to the test artifact that will be executed after the build is complete. If a
|
||||
# relative path is specified, it will be counted from the build directory.
|
||||
#
|
||||
# TESTNAME: a custom test name to use instead of the one derived from the source directory name
|
||||
#
|
||||
# BUILD_OPTIONS: a list of -D style CMake definitions to pass to ctest's --build-options (which
|
||||
# are ultimately passed to the CMake invocation of the test project)
|
||||
macro(_qt_internal_test_expect_pass _dir)
|
||||
cmake_parse_arguments(_ARGS "" "BINARY;TESTNAME" "BUILD_OPTIONS" ${ARGN})
|
||||
|
||||
cmake_parse_arguments(_ARGS "SIMULATE_IN_SOURCE" "BINARY;TESTNAME" "BUILD_OPTIONS" ${ARGN})
|
||||
if(_ARGS_TESTNAME)
|
||||
set(testname "${_ARGS_TESTNAME}")
|
||||
else()
|
||||
string(REPLACE "(" "_" testname "${_dir}")
|
||||
string(REPLACE ")" "_" testname "${testname}")
|
||||
string(REPLACE "/" "_" testname "${testname}")
|
||||
endif()
|
||||
|
||||
set(__expect_pass__prefixes "${CMAKE_PREFIX_PATH}")
|
||||
string(REPLACE ";" "\;" __expect_pass__prefixes "${__expect_pass__prefixes}")
|
||||
set(__expect_pass_prefixes "${CMAKE_PREFIX_PATH}")
|
||||
string(REPLACE ";" "\;" __expect_pass_prefixes "${__expect_pass_prefixes}")
|
||||
|
||||
set(ctest_command_args
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${_dir}"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${_dir}"
|
||||
--build-config "${CMAKE_BUILD_TYPE}"
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--build-makeprogram "${CMAKE_MAKE_PROGRAM}"
|
||||
--build-project "${_dir}"
|
||||
--build-options "-DCMAKE_PREFIX_PATH=${__expect_pass__prefixes}" ${BUILD_OPTIONS_LIST}
|
||||
${_ARGS_BUILD_OPTIONS}
|
||||
--test-command ${_ARGS_BINARY})
|
||||
add_test(${testname} ${CMAKE_CTEST_COMMAND} ${ctest_command_args})
|
||||
if(_ARGS_BINARY)
|
||||
_qt_internal_set_up_test_run_environment("${testname}")
|
||||
endif()
|
||||
set(__expect_pass_build_dir "${CMAKE_CURRENT_BINARY_DIR}/${_dir}")
|
||||
set(__expect_pass_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}")
|
||||
if(_ARGS_SIMULATE_IN_SOURCE)
|
||||
set(__expect_pass_in_source_build_dir "${CMAKE_CURRENT_BINARY_DIR}/in_source")
|
||||
set(__expect_pass_build_dir "${__expect_pass_in_source_build_dir}/${_dir}/build")
|
||||
set(__expect_pass_source_dir "${__expect_pass_in_source_build_dir}/${_dir}")
|
||||
|
||||
unset(__expect_pass_in_source_build_dir)
|
||||
endif()
|
||||
|
||||
if(_ARGS_BINARY AND NOT IS_ABSOLUTE "${_ARGS_BINARY}")
|
||||
set(_ARGS_BINARY "${__expect_pass_build_dir}/${_ARGS_BINARY}")
|
||||
endif()
|
||||
|
||||
if(_ARGS_SIMULATE_IN_SOURCE)
|
||||
add_test(NAME ${testname}_cleanup
|
||||
COMMAND ${CMAKE_COMMAND} -E remove_directory "${__expect_pass_source_dir}"
|
||||
)
|
||||
set_tests_properties(${testname}_cleanup PROPERTIES
|
||||
FIXTURES_SETUP "${testname}SIMULATE_IN_SOURCE_FIXTURE"
|
||||
)
|
||||
add_test(${testname}_copy_sources ${CMAKE_COMMAND} -E copy_directory
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" "${__expect_pass_source_dir}"
|
||||
)
|
||||
set_tests_properties(${testname}_copy_sources PROPERTIES
|
||||
FIXTURES_SETUP "${testname}SIMULATE_IN_SOURCE_FIXTURE"
|
||||
DEPENDS ${testname}_cleanup
|
||||
)
|
||||
endif()
|
||||
|
||||
set(ctest_command_args
|
||||
--build-and-test
|
||||
"${__expect_pass_source_dir}"
|
||||
"${__expect_pass_build_dir}"
|
||||
--build-config "${CMAKE_BUILD_TYPE}"
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--build-makeprogram "${CMAKE_MAKE_PROGRAM}"
|
||||
--build-project "${_dir}"
|
||||
--build-options "-DCMAKE_PREFIX_PATH=${__expect_pass_prefixes}" ${BUILD_OPTIONS_LIST}
|
||||
${_ARGS_BUILD_OPTIONS}
|
||||
--test-command ${_ARGS_BINARY}
|
||||
)
|
||||
add_test(${testname} ${CMAKE_CTEST_COMMAND} ${ctest_command_args})
|
||||
if(_ARGS_SIMULATE_IN_SOURCE)
|
||||
set_tests_properties(${testname} PROPERTIES
|
||||
FIXTURES_REQUIRED "${testname}SIMULATE_IN_SOURCE_FIXTURE")
|
||||
endif()
|
||||
|
||||
if(_ARGS_BINARY)
|
||||
_qt_internal_set_up_test_run_environment("${testname}")
|
||||
endif()
|
||||
|
||||
unset(__expect_pass_source_dir)
|
||||
unset(__expect_pass_build_dir)
|
||||
unset(__expect_pass_prefixes)
|
||||
endmacro()
|
||||
|
||||
# Checks if the build of the test project fails.
|
||||
# This test passes if the test project fails either at the
|
||||
# configuring or build steps.
|
||||
# Arguments: See _qt_internal_test_expect_pass
|
||||
macro(_qt_internal_test_expect_fail)
|
||||
_qt_internal_test_expect_pass(${ARGV})
|
||||
set_tests_properties(${testname} PROPERTIES WILL_FAIL TRUE)
|
||||
|
@ -92,6 +92,10 @@ enum {
|
||||
FillBufferNoexcept = true
|
||||
};
|
||||
|
||||
#if defined(QT_BUILD_INTERNAL)
|
||||
QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC_INITIALIZER(0U);
|
||||
#endif
|
||||
|
||||
struct QRandomGenerator::SystemGenerator
|
||||
{
|
||||
#if QT_CONFIG(getentropy)
|
||||
|
@ -71,9 +71,7 @@ enum RNGType {
|
||||
MersenneTwister = 1
|
||||
};
|
||||
|
||||
#if defined(QT_BUILD_INTERNAL) && defined(QT_BUILD_CORE_LIB)
|
||||
Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control = Q_BASIC_ATOMIC_INITIALIZER(0U);
|
||||
#elif defined(QT_BUILD_INTERNAL)
|
||||
#if defined(QT_BUILD_INTERNAL)
|
||||
extern Q_CORE_EXPORT QBasicAtomicInteger<uint> qt_randomdevice_control;
|
||||
#else
|
||||
static const struct
|
||||
|
@ -469,7 +469,7 @@ QList<xkb_keysym_t> QXkbCommon::toKeysym(QKeyEvent *event)
|
||||
} else if (event->modifiers() & Qt::KeypadModifier) {
|
||||
if (qtKey >= Qt::Key_0 && qtKey <= Qt::Key_9)
|
||||
keysyms.append(XKB_KEY_KP_0 + (qtKey - Qt::Key_0));
|
||||
} else if (isLatin(qtKey) && event->text().isUpper()) {
|
||||
} else if (isLatin1(qtKey) && event->text().isUpper()) {
|
||||
keysyms.append(qtKey);
|
||||
}
|
||||
|
||||
@ -521,7 +521,7 @@ int QXkbCommon::keysymToQtKey(xkb_keysym_t keysym, Qt::KeyboardModifiers modifie
|
||||
// With standard shortcuts we should prefer a latin character, this is
|
||||
// for checks like "some qkeyevent == QKeySequence::Copy" to work even
|
||||
// when using for example 'russian' keyboard layout.
|
||||
if (!QXkbCommon::isLatin(keysym)) {
|
||||
if (!QXkbCommon::isLatin1(keysym)) {
|
||||
xkb_keysym_t latinKeysym = QXkbCommon::lookupLatinKeysym(state, code);
|
||||
if (latinKeysym != XKB_KEY_NoSymbol)
|
||||
keysym = latinKeysym;
|
||||
@ -544,7 +544,7 @@ static int keysymToQtKey_internal(xkb_keysym_t keysym, Qt::KeyboardModifiers mod
|
||||
} else if (keysym >= XKB_KEY_KP_0 && keysym <= XKB_KEY_KP_9) {
|
||||
// numeric keypad keys
|
||||
qtKey = Qt::Key_0 + (keysym - XKB_KEY_KP_0);
|
||||
} else if (QXkbCommon::isLatin(keysym)) {
|
||||
} else if (QXkbCommon::isLatin1(keysym)) {
|
||||
qtKey = QXkbCommon::qxkbcommon_xkb_keysym_to_upper(keysym);
|
||||
} else {
|
||||
// check if we have a direct mapping
|
||||
@ -677,7 +677,7 @@ QList<int> QXkbCommon::possibleKeys(xkb_state *state, const QKeyEvent *event,
|
||||
Qt::KeyboardModifiers neededMods = ModsTbl[i];
|
||||
if ((modifiers & neededMods) == neededMods) {
|
||||
if (i == 8) {
|
||||
if (isLatin(baseQtKey))
|
||||
if (isLatin1(baseQtKey))
|
||||
continue;
|
||||
// add a latin key as a fall back key
|
||||
sym = lookupLatinKeysym(state, keycode);
|
||||
@ -732,7 +732,7 @@ void QXkbCommon::verifyHasLatinLayout(xkb_keymap *keymap)
|
||||
for (xkb_layout_index_t layout = 0; layout < layoutCount; ++layout) {
|
||||
for (xkb_keycode_t code = minKeycode; code < maxKeycode; ++code) {
|
||||
xkb_keymap_key_get_syms_by_level(keymap, code, layout, 0, &keysyms);
|
||||
if (keysyms && isLatin(keysyms[0]))
|
||||
if (keysyms && isLatin1(keysyms[0]))
|
||||
nrLatinKeys++;
|
||||
if (nrLatinKeys > 10) // arbitrarily chosen threshold
|
||||
return;
|
||||
@ -765,7 +765,7 @@ xkb_keysym_t QXkbCommon::lookupLatinKeysym(xkb_state *state, xkb_keycode_t keyco
|
||||
xkb_level_index_t level = xkb_state_key_get_level(state, keycode, layout);
|
||||
if (xkb_keymap_key_get_syms_by_level(keymap, keycode, layout, level, &syms) != 1)
|
||||
continue;
|
||||
if (isLatin(syms[0])) {
|
||||
if (isLatin1(syms[0])) {
|
||||
sym = syms[0];
|
||||
break;
|
||||
}
|
||||
|
@ -94,8 +94,8 @@ public:
|
||||
static void verifyHasLatinLayout(xkb_keymap *keymap);
|
||||
static xkb_keysym_t lookupLatinKeysym(xkb_state *state, xkb_keycode_t keycode);
|
||||
|
||||
static bool isLatin(xkb_keysym_t sym) {
|
||||
return ((sym >= 'a' && sym <= 'z') || (sym >= 'A' && sym <= 'Z'));
|
||||
static bool isLatin1(xkb_keysym_t sym) {
|
||||
return sym <= 0xff;
|
||||
}
|
||||
static bool isKeypad(xkb_keysym_t sym) {
|
||||
return sym >= XKB_KEY_KP_Space && sym <= XKB_KEY_KP_9;
|
||||
|
@ -108,26 +108,10 @@ _qt_internal_test_expect_pass(test_platform_defs_include)
|
||||
_qt_internal_test_expect_pass(test_qtmainwin_library)
|
||||
|
||||
if (CMAKE_GENERATOR STREQUAL Ninja AND UNIX AND NOT WIN32)
|
||||
set(qfindtestdata_build_dir "${CMAKE_CURRENT_SOURCE_DIR}/test_QFINDTESTDATA/build")
|
||||
add_test(test_QFINDTESTDATA ${CMAKE_CTEST_COMMAND}
|
||||
--build-and-test
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/test_QFINDTESTDATA"
|
||||
# Build in a subdir of the source dir.
|
||||
# This causes Ninja to use relative paths.
|
||||
"${qfindtestdata_build_dir}"
|
||||
--build-config "${CMAKE_BUILD_TYPE}"
|
||||
--build-generator "${CMAKE_GENERATOR}"
|
||||
--build-makeprogram "${CMAKE_MAKE_PROGRAM}"
|
||||
--build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
|
||||
_qt_internal_test_expect_pass(test_QFINDTESTDATA
|
||||
BINARY "tests/test_QFINDTESTDATA"
|
||||
SIMULATE_IN_SOURCE
|
||||
)
|
||||
set_tests_properties(test_QFINDTESTDATA PROPERTIES FIXTURES_SETUP QFINDTESTDATA)
|
||||
|
||||
add_test(NAME run_test_QFINDTESTDATA COMMAND sh -c "cd \"${qfindtestdata_build_dir}/tests\" && ./test_QFINDTESTDATA -v2")
|
||||
set_tests_properties(run_test_QFINDTESTDATA PROPERTIES FIXTURES_REQUIRED QFINDTESTDATA)
|
||||
|
||||
# source dir should be untouched by build, so remove build results
|
||||
add_test(NAME cleanup_test_QFINDTESTDATA COMMAND sh -c "rm -rf \"${qfindtestdata_build_dir}\"")
|
||||
set_tests_properties(cleanup_test_QFINDTESTDATA PROPERTIES FIXTURES_CLEANUP QFINDTESTDATA)
|
||||
endif()
|
||||
|
||||
if (NOT NO_DBUS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user