Merge integration refs/builds/qtci/dev/1617698863

This commit is contained in:
Qt CI Bot 2021-04-06 13:47:42 +00:00
commit 8398f9dada
14 changed files with 102 additions and 37 deletions

View File

@ -511,11 +511,13 @@ macro(qt_build_tests)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/auto/CMakeLists.txt") if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/auto/CMakeLists.txt")
add_subdirectory(auto) add_subdirectory(auto)
endif() endif()
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/CMakeLists.txt" AND QT_BUILD_BENCHMARKS) if(NOT QT_BUILD_MINIMAL_STATIC_TESTS)
add_subdirectory(benchmarks) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/benchmarks/CMakeLists.txt" AND QT_BUILD_BENCHMARKS)
endif() add_subdirectory(benchmarks)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/manual/CMakeLists.txt" AND QT_BUILD_MANUAL_TESTS) endif()
add_subdirectory(manual) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/manual/CMakeLists.txt" AND QT_BUILD_MANUAL_TESTS)
add_subdirectory(manual)
endif()
endif() endif()
endmacro() endmacro()

View File

@ -662,7 +662,7 @@ function(check_qt_build_parts type)
set(buildFlag "FALSE") set(buildFlag "FALSE")
endif() endif()
list(APPEND knownParts "tests" "examples" "benchmarks") list(APPEND knownParts "tests" "examples" "benchmarks" "manual-tests" "minimal-static-tests")
foreach(part ${${input}}) foreach(part ${${input}})
if(part IN_LIST knownParts) if(part IN_LIST knownParts)

View File

@ -164,6 +164,7 @@ option(QT_BUILD_EXAMPLES "Build Qt examples" OFF)
option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON) option(QT_BUILD_EXAMPLES_BY_DEFAULT "Should examples be built as part of the default 'all' target." ON)
option(QT_BUILD_MANUAL_TESTS "Build Qt manual tests" OFF) option(QT_BUILD_MANUAL_TESTS "Build Qt manual tests" OFF)
option(QT_BUILD_MINIMAL_STATIC_TESTS "Build minimal subset of tests for static Qt builds" OFF)
## Find host tools (if non native): ## Find host tools (if non native):
set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.") set(QT_HOST_PATH "" CACHE PATH "Installed Qt host directory path, used for cross compiling.")

View File

@ -23,6 +23,15 @@ instructions:
env_var: COIN_CMAKE_ARGS env_var: COIN_CMAKE_ARGS
equals_value: null equals_value: null
# Inform CMake to build just a minimal set of tests for static Qt builds.
- type: AppendToEnvironmentVariable
variableName: COIN_CMAKE_ARGS
variableValue: " -DQT_BUILD_MINIMAL_STATIC_TESTS=ON"
enable_if:
condition: property
property: features
contains_value: "MinimalStaticTests"
- !include "{{qt/qtbase}}/call_cmake_for_standalone_tests.yaml" - !include "{{qt/qtbase}}/call_cmake_for_standalone_tests.yaml"
- type: ExecuteCommand - type: ExecuteCommand
command: "{{.Env.TESTS_ENV_PREFIX}} cmake --build . --parallel -v" command: "{{.Env.TESTS_ENV_PREFIX}} cmake --build . --parallel -v"
@ -35,7 +44,3 @@ instructions:
archiveDirectory: "{{.BuildDir}}" archiveDirectory: "{{.BuildDir}}"
maxTimeInSeconds: 1200 maxTimeInSeconds: 1200
maxTimeBetweenOutput: 1200 maxTimeBetweenOutput: 1200
disable_if:
condition: property
property: configureArgs
contains_value: "-DBUILD_SHARED_LIBS=OFF"

View File

@ -2,7 +2,3 @@ type: Group
instructions: instructions:
- !include "{{qt/qtbase}}/cmake_regular_test_instructions_common.yaml" - !include "{{qt/qtbase}}/cmake_regular_test_instructions_common.yaml"
- !include "{{qt/qtbase}}/cmake_run_ctest_enforce_exit_code.yaml" - !include "{{qt/qtbase}}/cmake_run_ctest_enforce_exit_code.yaml"
disable_if:
condition: property
property: configureArgs
contains_value: "-DBUILD_SHARED_LIBS=OFF"

View File

@ -175,8 +175,10 @@ Component selection:
-skip <repo> ......... Exclude an entire repository from the build. -skip <repo> ......... Exclude an entire repository from the build.
-make <part> ......... Add <part> to the list of parts to be built. -make <part> ......... Add <part> to the list of parts to be built.
Specifying this option clears the default list first. Specifying this option clears the default list first.
[libs and examples, also tools if not cross-building, (allowed values: libs, tools, examples, tests,
also tests if -developer-build] benchmarks, manual-tests, minimal-static-tests)
[default: libs and examples, also tools if not
cross-building, also tests if -developer-build]
-nomake <part> ....... Exclude <part> from the list of parts to be built. -nomake <part> ....... Exclude <part> from the list of parts to be built.
-gui ................. Build the Qt GUI module and dependencies [yes] -gui ................. Build the Qt GUI module and dependencies [yes]
-widgets ............. Build the Qt Widgets module and dependencies [yes] -widgets ............. Build the Qt Widgets module and dependencies [yes]

View File

@ -74,13 +74,14 @@ qt_commandline_option(linker TYPE optionalString VALUES bfd gold lld)
qt_commandline_option(ltcg TYPE boolean) qt_commandline_option(ltcg TYPE boolean)
# special case begin # special case begin
qt_commandline_option(make TYPE addString VALUES examples libs tests tools qt_commandline_option(make TYPE addString VALUES examples libs tests tools
benchmarks) benchmarks manual-tests minimal-static-tests)
# special case end # special case end
qt_commandline_option(make-tool TYPE string) qt_commandline_option(make-tool TYPE string)
qt_commandline_option(mips_dsp TYPE boolean) qt_commandline_option(mips_dsp TYPE boolean)
qt_commandline_option(mips_dspr2 TYPE boolean) qt_commandline_option(mips_dspr2 TYPE boolean)
qt_commandline_option(mp TYPE boolean NAME msvc_mp) qt_commandline_option(mp TYPE boolean NAME msvc_mp)
qt_commandline_option(nomake TYPE addString VALUES examples tests tools benchmarks) # special case qt_commandline_option(nomake TYPE addString VALUES examples tests tools benchmarks
manual-tests minimal-static-tests) # special case
qt_commandline_option(opensource TYPE void NAME commercial VALUE no) qt_commandline_option(opensource TYPE void NAME commercial VALUE no)
qt_commandline_option(optimize-debug TYPE boolean NAME optimize_debug) qt_commandline_option(optimize-debug TYPE boolean NAME optimize_debug)
qt_commandline_option(optimize-size TYPE boolean NAME optimize_size) qt_commandline_option(optimize-size TYPE boolean NAME optimize_size)

View File

@ -408,6 +408,14 @@ bool QWindowsPipeReader::consumePendingAndEmit(bool allowWinActPosting)
mutex.unlock(); mutex.unlock();
// Trigger 'pipeBroken' only once. This flag must be updated before
// emitting the readyRead() signal. Otherwise, the read sequence will
// be considered not finished, and we may hang if a slot connected
// to readyRead() calls waitForReadyRead().
const bool emitPipeClosed = (dwError != ERROR_SUCCESS && !pipeBroken);
if (emitPipeClosed)
pipeBroken = true;
// Disable any further processing, if the pipe was stopped. // Disable any further processing, if the pipe was stopped.
// We are not allowed to emit signals in either 'Stopped' // We are not allowed to emit signals in either 'Stopped'
// or 'Draining' state. // or 'Draining' state.
@ -418,10 +426,7 @@ bool QWindowsPipeReader::consumePendingAndEmit(bool allowWinActPosting)
QScopedValueRollback<bool> guard(inReadyRead, true); QScopedValueRollback<bool> guard(inReadyRead, true);
emit readyRead(); emit readyRead();
} }
if (emitPipeClosed) {
// Trigger 'pipeBroken' only once.
if (dwError != ERROR_SUCCESS && !pipeBroken) {
pipeBroken = true;
if (dwError != ERROR_BROKEN_PIPE && dwError != ERROR_PIPE_NOT_CONNECTED) if (dwError != ERROR_BROKEN_PIPE && dwError != ERROR_PIPE_NOT_CONNECTED)
emit winError(dwError, QLatin1String("QWindowsPipeReader::consumePendingAndEmit")); emit winError(dwError, QLatin1String("QWindowsPipeReader::consumePendingAndEmit"));
emit pipeClosed(); emit pipeClosed();

View File

@ -22,6 +22,12 @@ if (TARGET Qt::Xml AND TARGET Qt::Sql AND TARGET Qt::Network)
add_subdirectory(cmake) add_subdirectory(cmake)
endif() endif()
# special case end # special case end
# Limit set of tests to run for static Qt builds.
if(QT_BUILD_MINIMAL_STATIC_TESTS)
return()
endif()
if (TARGET Qt::Concurrent) if (TARGET Qt::Concurrent)
add_subdirectory(concurrent) add_subdirectory(concurrent)
endif() endif()

View File

@ -14,23 +14,15 @@ add_executable(test_interface_exe WIN32 main.cpp mainwindow.cpp)
# link explicitly to Qt::WinMain. # link explicitly to Qt::WinMain.
target_link_libraries(test_interface_exe Qt::Widgets) target_link_libraries(test_interface_exe Qt::Widgets)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/try_compile-test.cpp"
"
#include <QString>
#include <QWidget>
int main(int,char**) { QWidget w; w.show(); return 0; }
"
)
# Fix try_compile to inherit the parent configuration. # Fix try_compile to inherit the parent configuration.
set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}") set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}")
# The try_compile works because Qt::Widgets is listed in the LINK_LIBRARIES, # Can't use source file based try_compile, because it doesn't handle object libraries
# which causes the includes, defines and appropriate PIC flag to be used. # referenced in generator expressions properly.
try_compile(_TRY_COMPILE_RES "${CMAKE_CURRENT_BINARY_DIR}/try_compile-test" try_compile(_TRY_COMPILE_RES
"${CMAKE_CURRENT_BINARY_DIR}/try_compile-test.cpp" "${CMAKE_CURRENT_BINARY_DIR}/widget_test"
LINK_LIBRARIES Qt::Widgets "${CMAKE_CURRENT_SOURCE_DIR}/widget_test"
widget_test
OUTPUT_VARIABLE TC_OV OUTPUT_VARIABLE TC_OV
) )

View File

@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 3.14)
project(test_interface_try_compile)
find_package(Qt6Widgets)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(test_interface_try_compile_exe main.cpp)
target_link_libraries(test_interface_try_compile_exe Qt::Widgets)

View File

@ -0,0 +1,4 @@
#include <QString>
#include <QWidget>
int main(int, char**) { QWidget w; w.show(); return 0; }

View File

@ -746,6 +746,9 @@ void tst_qmessagehandler::qMessagePattern_data()
#define QT_NAMESPACE_STR "" #define QT_NAMESPACE_STR ""
#endif #endif
#if QT_CONFIG(static)
QSKIP("These test cases don't work with static Qt builds");
#else
#ifndef QT_NO_DEBUG #ifndef QT_NO_DEBUG
QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>() QTest::newRow("backtrace") << "[%{backtrace}] %{message}" << true << (QList<QByteArray>()
// MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro // MyClass::qt_static_metacall is explicitly marked as hidden in the Q_OBJECT macro
@ -755,7 +758,8 @@ void tst_qmessagehandler::qMessagePattern_data()
QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>() QTest::newRow("backtrace depth,separator") << "[%{backtrace depth=2 separator=\"\n\"}] %{message}" << true << (QList<QByteArray>()
<< "[MyClass::myFunction\nMyClass::mySlot1] from_a_function 34" << "[MyClass::myFunction\nMyClass::mySlot1] from_a_function 34"
<< "[T::T\n"); << "[T::T\n");
#endif #endif // #if !QT_CONFIG(process)
#endif // #ifdef __GLIBC__
} }

View File

@ -111,6 +111,7 @@ private slots:
void longPath(); void longPath();
void waitForDisconnect(); void waitForDisconnect();
void waitForDisconnectByServer(); void waitForDisconnectByServer();
void waitForReadyReadOnDisconnected();
void removeServer(); void removeServer();
@ -1151,6 +1152,40 @@ void tst_QLocalSocket::waitForDisconnectByServer()
QCOMPARE(spy.count(), 1); QCOMPARE(spy.count(), 1);
} }
void tst_QLocalSocket::waitForReadyReadOnDisconnected()
{
QString name = "tst_localsocket";
LocalServer server;
QVERIFY(server.listen(name));
LocalSocket socket;
connect(&socket, &QLocalSocket::readyRead, [&socket]() {
QVERIFY(socket.getChar(nullptr));
// The next call should not block because the socket was closed
// by the peer.
QVERIFY(!socket.waitForReadyRead(3000));
});
socket.connectToServer(name);
QVERIFY(socket.waitForConnected(3000));
QVERIFY(server.waitForNewConnection(3000));
QLocalSocket *serverSocket = server.nextPendingConnection();
QVERIFY(serverSocket);
QVERIFY(serverSocket->putChar(0));
QVERIFY(serverSocket->waitForBytesWritten(3000));
serverSocket->close();
#ifdef Q_OS_WIN
// Ensure that the asynchronously delivered close notification is
// already queued up before we consume the data.
QTest::qSleep(250);
#endif
QElapsedTimer timer;
timer.start();
QVERIFY(socket.waitForReadyRead(5000));
QVERIFY(timer.elapsed() < 2000);
}
void tst_QLocalSocket::removeServer() void tst_QLocalSocket::removeServer()
{ {
// this is a hostile takeover, but recovering from a crash results in the same // this is a hostile takeover, but recovering from a crash results in the same