summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-10-18 11:48:37 +0200
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-10-22 07:46:43 +0000
commit02b15fdd8ac7515c4d012f5dfa2c636aab357350 (patch)
treebe15bdaa1d68e357bddc0700417fb8a400758e50
parent7df45b8ea6fa7e4ba1ae80ad061dcdc52572a74b (diff)
Fix CMake tests
Change-Id: I5a79cfc3bab647f9bec29e8b08f9262b211c83b1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--tests/auto/cmake/CMakeLists.txt14
-rw-r--r--tests/auto/cmake/abstracthttpserver/CMakeLists.txt7
-rw-r--r--tests/auto/cmake/abstracthttpserver/main.cpp50
3 files changed, 67 insertions, 4 deletions
diff --git a/tests/auto/cmake/CMakeLists.txt b/tests/auto/cmake/CMakeLists.txt
index 5a24d26..ed202db 100644
--- a/tests/auto/cmake/CMakeLists.txt
+++ b/tests/auto/cmake/CMakeLists.txt
@@ -9,8 +9,14 @@ find_package(Qt5Core REQUIRED)
include("${_Qt5CTestMacros}")
-test_module_includes(
- HttpServer QHttpServer
+add_test(qabstracthttpserver_test ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMAKE_CURRENT_SOURCE_DIR}/abstracthttpserver/"
+ "${CMAKE_CURRENT_BINARY_DIR}/abstracthttpserver"
+ --build-config "${CMAKE_BUILD_TYPE}"
+ --build-generator ${CMAKE_GENERATOR}
+ --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+ --build-project qabstracthttpserver_test
+ --build-options "-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" ${BUILD_OPTIONS_LIST}
+ --test-command qabstracthttpserver_test
)
-
-expect_pass(test_plugins)
diff --git a/tests/auto/cmake/abstracthttpserver/CMakeLists.txt b/tests/auto/cmake/abstracthttpserver/CMakeLists.txt
new file mode 100644
index 0000000..0d49823
--- /dev/null
+++ b/tests/auto/cmake/abstracthttpserver/CMakeLists.txt
@@ -0,0 +1,7 @@
+cmake_minimum_required(VERSION 2.8)
+project(qabstracthttpserver_test)
+
+find_package(Qt5 COMPONENTS HttpServer REQUIRED)
+
+add_executable(qabstracthttpserver_test "${CMAKE_CURRENT_SOURCE_DIR}/main.cpp")
+target_link_libraries(qabstracthttpserver_test Qt5::HttpServer)
diff --git a/tests/auto/cmake/abstracthttpserver/main.cpp b/tests/auto/cmake/abstracthttpserver/main.cpp
new file mode 100644
index 0000000..a1c859e
--- /dev/null
+++ b/tests/auto/cmake/abstracthttpserver/main.cpp
@@ -0,0 +1,50 @@
+/****************************************************************************
+**
+** Copyright (C) 2018 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtHttpServer/qabstracthttpserver.h>
+
+int main()
+{
+ struct HttpServer : QAbstractHttpServer {
+ bool handleRequest(const QHttpServerRequest &, QTcpSocket *) override
+ {
+ return false;
+ }
+ } httpServer;
+ Q_UNUSED(httpServer);
+ return 0;
+}