summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CMakeLists.txt30
-rw-r--r--Tests/QtAutogen/CommonTests.cmake1
-rw-r--r--Tests/QtAutogen/RerunRccDepends/CMakeLists.txt (renamed from Tests/QtAutogenRerun/rccDepends.cmake)20
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt (renamed from Tests/QtAutogenRerun/rccDepends/CMakeLists.txt)32
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp (renamed from Tests/QtAutogenRerun/rccDepends/main.cpp)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in (renamed from Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in)0
-rw-r--r--Tests/QtAutogen/RerunRccDepends/dummy.cpp (renamed from Tests/QtAutogenRerun/dummy.cpp)0
-rw-r--r--Tests/QtAutogenRerun/CMakeLists.txt43
-rw-r--r--Tests/QtAutogenRerun/defines_test/CMakeLists.txt4
-rw-r--r--Tests/QtAutogenRerun/defines_test/defines_test.cpp38
17 files changed, 27 insertions, 141 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index b0bf887d91..46dc2248ad 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1263,21 +1263,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(CMake_TEST_Qt5 AND Qt5Widgets_FOUND)
add_subdirectory(Qt5Autogen)
- add_test(NAME Qt5AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun"
- "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun"
- ${build_generator_args}
- --build-project QtAutogenRerun
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun"
- --force-new-ctest-process
- --build-options ${build_options}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
- -DQT_TEST_VERSION=5
- ${QtAutogen_BUILD_OPTIONS}
- )
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt5AutogenRerun")
-
add_test(Qt5AutoUicInterface ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
@@ -1295,21 +1280,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release
if(QT4_WORKS AND QT_QTGUI_FOUND)
add_subdirectory(Qt4Autogen)
- add_test(NAME Qt4AutogenRerun COMMAND ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/QtAutogenRerun"
- "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun"
- ${build_generator_args}
- --build-project QtAutogenRerun
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun"
- --force-new-ctest-process
- --build-options ${build_options}
- -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
- -DQT_TEST_VERSION=4
- ${QtAutogen_BUILD_OPTIONS}
- )
- list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4AutogenRerun")
-
add_test(Qt4AutoUicInterface ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/QtAutoUicInterface"
diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index b03c282ec2..5746ab5b98 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -36,3 +36,4 @@ ADD_AUTOGEN_TEST(RerunMocBasic)
if(NOT QT_TEST_VERSION STREQUAL 4)
ADD_AUTOGEN_TEST(RerunMocPlugin)
endif()
+ADD_AUTOGEN_TEST(RerunRccDepends)
diff --git a/Tests/QtAutogenRerun/rccDepends.cmake b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
index 68e1482512..2e6a5bd47a 100644
--- a/Tests/QtAutogenRerun/rccDepends.cmake
+++ b/Tests/QtAutogen/RerunRccDepends/CMakeLists.txt
@@ -1,8 +1,17 @@
+cmake_minimum_required(VERSION 3.10)
+project(RerunRccDepends)
+include("../AutogenTest.cmake")
+
+# Tests rcc rebuilding when a resource file changes
+
+# Dummy executable to generate a clean target
+add_executable(dummy dummy.cpp)
+
# When a .qrc or a file listed in a .qrc file changes,
# the target must be rebuilt
set(timeformat "%Y%j%H%M%S")
-set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/rccDepends")
-set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/rccDepends")
+set(rccDepSD "${CMAKE_CURRENT_SOURCE_DIR}/RccDepends")
+set(rccDepBD "${CMAKE_CURRENT_BINARY_DIR}/RccDepends")
# Initial build
configure_file(${rccDepSD}/resPlainA.qrc.in ${rccDepBD}/resPlain.qrc COPYONLY)
@@ -10,10 +19,9 @@ configure_file(${rccDepSD}/resGenA.qrc.in ${rccDepBD}/resGen.qrc.in COPYONLY)
try_compile(RCC_DEPENDS
"${rccDepBD}"
"${rccDepSD}"
- rccDepends
- CMAKE_FLAGS "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
- "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
- "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}"
+ RccDepends
+ CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}"
+ "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}"
OUTPUT_VARIABLE output
)
if (NOT RCC_DEPENDS)
diff --git a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
index 291592e7db..0507e619e0 100644
--- a/Tests/QtAutogenRerun/rccDepends/CMakeLists.txt
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/CMakeLists.txt
@@ -1,17 +1,6 @@
-cmake_minimum_required(VERSION 3.9)
-project(rccDepends CXX)
-
-if (QT_TEST_VERSION STREQUAL 4)
- find_package(Qt4 REQUIRED)
- set(QT_CORE_TARGET Qt4::QtCore)
-else()
- if (NOT QT_TEST_VERSION STREQUAL 5)
- message(SEND_ERROR "Invalid Qt version specified.")
- endif()
-
- find_package(Qt5Core REQUIRED)
- set(QT_CORE_TARGET Qt5::Core)
-endif()
+cmake_minimum_required(VERSION 3.10)
+project(RccDepends)
+include("../../AutogenTest.cmake")
# Enable AUTORCC for all targets
set(CMAKE_AUTORCC ON)
@@ -23,19 +12,22 @@ configure_file(resGen/input.txt.in resGen/input.txt COPYONLY)
configure_file(resGen/input.txt.in resGen/inputAdded.txt COPYONLY)
# Generated qrc file with dependency
-add_custom_command(OUTPUT resGen.qrc
+add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in
COMMAND ${CMAKE_COMMAND} -E sleep 2
- COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc)
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc.in ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc
+)
# Target that uses a plain .qrc file
add_executable(rccDependsPlain main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resPlain.qrc)
-target_link_libraries(rccDependsPlain ${QT_CORE_TARGET})
+target_link_libraries(rccDependsPlain ${QT_QTCORE_TARGET})
add_custom_command(TARGET rccDependsPlain POST_BUILD COMMAND
- ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsPlain>" > targetPlain.txt)
+ ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsPlain>" > targetPlain.txt
+)
# Target that uses a GENERATED .qrc file
add_executable(rccDependsGen main.cpp ${CMAKE_CURRENT_BINARY_DIR}/resGen.qrc )
-target_link_libraries(rccDependsGen ${QT_CORE_TARGET})
+target_link_libraries(rccDependsGen ${QT_QTCORE_TARGET})
add_custom_command(TARGET rccDependsGen POST_BUILD COMMAND
- ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsGen>" > targetGen.txt)
+ ${CMAKE_COMMAND} -E echo "$<TARGET_FILE:rccDependsGen>" > targetGen.txt
+)
diff --git a/Tests/QtAutogenRerun/rccDepends/main.cpp b/Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp
index 766b7751bf..766b7751bf 100644
--- a/Tests/QtAutogenRerun/rccDepends/main.cpp
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/main.cpp
diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in
index 4f24589b08..4f24589b08 100644
--- a/Tests/QtAutogenRerun/rccDepends/resGen/input.txt.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/input.txt.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in
index 4f24589b08..4f24589b08 100644
--- a/Tests/QtAutogenRerun/rccDepends/resGen/inputAdded.txt.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGen/inputAdded.txt.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in
index c131a3460f..c131a3460f 100644
--- a/Tests/QtAutogenRerun/rccDepends/resGenA.qrc.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenA.qrc.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in
index 8c7e643119..8c7e643119 100644
--- a/Tests/QtAutogenRerun/rccDepends/resGenB.qrc.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resGenB.qrc.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in
index a5e407a172..a5e407a172 100644
--- a/Tests/QtAutogenRerun/rccDepends/resPlain/input.txt.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/input.txt.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in
index a5e407a172..a5e407a172 100644
--- a/Tests/QtAutogenRerun/rccDepends/resPlain/inputAdded.txt.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlain/inputAdded.txt.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in
index c135d85b55..c135d85b55 100644
--- a/Tests/QtAutogenRerun/rccDepends/resPlainA.qrc.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainA.qrc.in
diff --git a/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in
index 186b6535a8..186b6535a8 100644
--- a/Tests/QtAutogenRerun/rccDepends/resPlainB.qrc.in
+++ b/Tests/QtAutogen/RerunRccDepends/RccDepends/resPlainB.qrc.in
diff --git a/Tests/QtAutogenRerun/dummy.cpp b/Tests/QtAutogen/RerunRccDepends/dummy.cpp
index 4837a76b87..4837a76b87 100644
--- a/Tests/QtAutogenRerun/dummy.cpp
+++ b/Tests/QtAutogen/RerunRccDepends/dummy.cpp
diff --git a/Tests/QtAutogenRerun/CMakeLists.txt b/Tests/QtAutogenRerun/CMakeLists.txt
deleted file mode 100644
index 9f1ee280c4..0000000000
--- a/Tests/QtAutogenRerun/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-cmake_minimum_required(VERSION 3.9)
-cmake_policy(SET CMP0071 NEW)
-project(QtAutogenRerun)
-
-# Tell find_package(Qt5) where to find Qt.
-if(QT_QMAKE_EXECUTABLE)
- get_filename_component(Qt_BIN_DIR "${QT_QMAKE_EXECUTABLE}" PATH)
- get_filename_component(Qt_PREFIX_DIR "${Qt_BIN_DIR}" PATH)
- list(APPEND CMAKE_PREFIX_PATH ${Qt_PREFIX_DIR})
-endif()
-
-if (QT_TEST_VERSION STREQUAL 4)
- find_package(Qt4 REQUIRED)
-
- # Include this directory before using the UseQt4 file.
- add_subdirectory(defines_test)
-
- include(UseQt4)
-
- set(QT_QTCORE_TARGET Qt4::QtCore)
-
-else()
- if (NOT QT_TEST_VERSION STREQUAL 5)
- message(SEND_ERROR "Invalid Qt version specified.")
- endif()
- find_package(Qt5Widgets REQUIRED)
-
- set(QT_QTCORE_TARGET Qt5::Core)
-
- include_directories(${Qt5Widgets_INCLUDE_DIRS})
- set(QT_LIBRARIES Qt5::Widgets)
-
- if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC)
- add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC})
- endif()
-
-endif()
-
-# Dummy executable to generate clean target
-add_executable(dummy dummy.cpp)
-
-# -- Test
-include("rccDepends.cmake")
diff --git a/Tests/QtAutogenRerun/defines_test/CMakeLists.txt b/Tests/QtAutogenRerun/defines_test/CMakeLists.txt
deleted file mode 100644
index 9ee9a228a6..0000000000
--- a/Tests/QtAutogenRerun/defines_test/CMakeLists.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-add_executable(defines_test defines_test.cpp)
-set_target_properties(defines_test PROPERTIES AUTOMOC TRUE)
-target_link_libraries(defines_test Qt4::QtGui)
diff --git a/Tests/QtAutogenRerun/defines_test/defines_test.cpp b/Tests/QtAutogenRerun/defines_test/defines_test.cpp
deleted file mode 100644
index cf4e9cb5b6..0000000000
--- a/Tests/QtAutogenRerun/defines_test/defines_test.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-
-#include <QObject>
-
-#ifdef QT_GUI_LIB
-#include <QTextDocument>
-
-class SomeDocument : public QTextDocument
-{
- Q_OBJECT
-
-Q_SIGNALS:
- void someSig();
-};
-#endif
-
-#ifdef QT_CORE_LIB
-class SomeObject : public QObject
-{
- Q_OBJECT
-
-Q_SIGNALS:
- void someSig();
-};
-#endif
-
-int main(int argc, char** argv)
-{
-#ifdef QT_CORE_LIB
- QMetaObject sosmo = SomeObject::staticMetaObject;
-#endif
-#ifdef QT_GUI_LIB
- QMetaObject sdsmo = SomeDocument::staticMetaObject;
-#endif
-
- return 0;
-}
-
-#include "defines_test.moc"