From f00e6c7c7024a784d2da310ba7b5f4a67e60fdff Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Fri, 8 Dec 2017 17:46:58 +0100 Subject: Autogen: Tests: Separate RccOnly and RccEmpty tests --- Tests/QtAutogen/CMakeLists.txt | 12 ------------ Tests/QtAutogen/CommonTests.cmake | 2 ++ Tests/QtAutogen/RccEmpty/CMakeLists.txt | 8 ++++++++ Tests/QtAutogen/RccEmpty/rccEmpty.cpp | 9 +++++++++ Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc | 4 ++++ Tests/QtAutogen/RccOnly/CMakeLists.txt | 8 ++++++++ Tests/QtAutogen/RccOnly/rccOnly.cpp | 9 +++++++++ Tests/QtAutogen/RccOnly/rccOnlyRes.qrc | 5 +++++ Tests/QtAutogen/rccEmpty.cpp | 9 --------- Tests/QtAutogen/rccEmptyRes.qrc | 4 ---- Tests/QtAutogen/rccOnly.cpp | 9 --------- Tests/QtAutogen/rccOnlyRes.qrc | 5 ----- 12 files changed, 45 insertions(+), 39 deletions(-) create mode 100644 Tests/QtAutogen/RccEmpty/CMakeLists.txt create mode 100644 Tests/QtAutogen/RccEmpty/rccEmpty.cpp create mode 100644 Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc create mode 100644 Tests/QtAutogen/RccOnly/CMakeLists.txt create mode 100644 Tests/QtAutogen/RccOnly/rccOnly.cpp create mode 100644 Tests/QtAutogen/RccOnly/rccOnlyRes.qrc delete mode 100644 Tests/QtAutogen/rccEmpty.cpp delete mode 100644 Tests/QtAutogen/rccEmptyRes.qrc delete mode 100644 Tests/QtAutogen/rccOnly.cpp delete mode 100644 Tests/QtAutogen/rccOnlyRes.qrc diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 85029d1..9125bd7 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -60,18 +60,6 @@ if(NON_ASCII_BDIR AND WIN32) endif() # -- Test -# RCC only -add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) -set_property(TARGET rccOnly PROPERTY AUTORCC ON) -target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) - -# -- Test -# RCC empty -add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) -set_property(TARGET rccEmpty PROPERTY AUTORCC ON) -target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) - -# -- Test # Add not_generated_file.qrc to the source list to get the file-level # dependency, but don't generate a c++ file from it. Disable the AUTORCC # feature for this target. This tests that qrc files in the sources don't diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 9121f41..0950062 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -4,3 +4,5 @@ ADD_AUTOGEN_TEST(MocOptions mocOptions) if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(UicOnly uicOnly) endif() +ADD_AUTOGEN_TEST(RccOnly rccOnly) +ADD_AUTOGEN_TEST(RccEmpty rccEmpty) diff --git a/Tests/QtAutogen/RccEmpty/CMakeLists.txt b/Tests/QtAutogen/RccEmpty/CMakeLists.txt new file mode 100644 index 0000000..3b16edc --- /dev/null +++ b/Tests/QtAutogen/RccEmpty/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(RccEmpty) +include("../AutogenTest.cmake") + +# Test AUTORCC on a .qrc file with no resource files +add_executable(rccEmpty rccEmpty.cpp rccEmptyRes.qrc) +set_property(TARGET rccEmpty PROPERTY AUTORCC ON) +target_link_libraries(rccEmpty ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/RccEmpty/rccEmpty.cpp b/Tests/QtAutogen/RccEmpty/rccEmpty.cpp new file mode 100644 index 0000000..7f2c527 --- /dev/null +++ b/Tests/QtAutogen/RccEmpty/rccEmpty.cpp @@ -0,0 +1,9 @@ + +extern int qInitResources_rccEmptyRes(); + +int main(int, char**) +{ + // Fails to link if the symbol is not present. + qInitResources_rccEmptyRes(); + return 0; +} diff --git a/Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc b/Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc new file mode 100644 index 0000000..4ca9cd5 --- /dev/null +++ b/Tests/QtAutogen/RccEmpty/rccEmptyRes.qrc @@ -0,0 +1,4 @@ + + + + diff --git a/Tests/QtAutogen/RccOnly/CMakeLists.txt b/Tests/QtAutogen/RccOnly/CMakeLists.txt new file mode 100644 index 0000000..a65dee4 --- /dev/null +++ b/Tests/QtAutogen/RccOnly/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(RccOnly) +include("../AutogenTest.cmake") + +# Test AUTORCC being enabled only +add_executable(rccOnly rccOnly.cpp rccOnlyRes.qrc) +set_property(TARGET rccOnly PROPERTY AUTORCC ON) +target_link_libraries(rccOnly ${QT_QTCORE_TARGET}) diff --git a/Tests/QtAutogen/RccOnly/rccOnly.cpp b/Tests/QtAutogen/RccOnly/rccOnly.cpp new file mode 100644 index 0000000..61c7bf4 --- /dev/null +++ b/Tests/QtAutogen/RccOnly/rccOnly.cpp @@ -0,0 +1,9 @@ + +extern int qInitResources_rccOnlyRes(); + +int main(int, char**) +{ + // Fails to link if the symbol is not present. + qInitResources_rccOnlyRes(); + return 0; +} diff --git a/Tests/QtAutogen/RccOnly/rccOnlyRes.qrc b/Tests/QtAutogen/RccOnly/rccOnlyRes.qrc new file mode 100644 index 0000000..5551348 --- /dev/null +++ b/Tests/QtAutogen/RccOnly/rccOnlyRes.qrc @@ -0,0 +1,5 @@ + + + rccOnly.cpp + + diff --git a/Tests/QtAutogen/rccEmpty.cpp b/Tests/QtAutogen/rccEmpty.cpp deleted file mode 100644 index 7f2c527..0000000 --- a/Tests/QtAutogen/rccEmpty.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -extern int qInitResources_rccEmptyRes(); - -int main(int, char**) -{ - // Fails to link if the symbol is not present. - qInitResources_rccEmptyRes(); - return 0; -} diff --git a/Tests/QtAutogen/rccEmptyRes.qrc b/Tests/QtAutogen/rccEmptyRes.qrc deleted file mode 100644 index 4ca9cd5..0000000 --- a/Tests/QtAutogen/rccEmptyRes.qrc +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/Tests/QtAutogen/rccOnly.cpp b/Tests/QtAutogen/rccOnly.cpp deleted file mode 100644 index 61c7bf4..0000000 --- a/Tests/QtAutogen/rccOnly.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -extern int qInitResources_rccOnlyRes(); - -int main(int, char**) -{ - // Fails to link if the symbol is not present. - qInitResources_rccOnlyRes(); - return 0; -} diff --git a/Tests/QtAutogen/rccOnlyRes.qrc b/Tests/QtAutogen/rccOnlyRes.qrc deleted file mode 100644 index 5551348..0000000 --- a/Tests/QtAutogen/rccOnlyRes.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - rccOnly.cpp - - -- cgit v0.12