From 5cab8c307c7df585152e3ab9e007574cb0e690dc Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Fri, 8 Dec 2017 18:55:43 +0100 Subject: Autogen: Tests: Separate RccSkipSource test --- Tests/QtAutogen/CMakeLists.txt | 21 --------------------- Tests/QtAutogen/CommonTests.cmake | 1 + Tests/QtAutogen/RccSkipSource/CMakeLists.txt | 23 +++++++++++++++++++++++ Tests/QtAutogen/RccSkipSource/skipRcc.cpp | 9 +++++++++ Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc | 5 +++++ Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc | 5 +++++ Tests/QtAutogen/RccSkipSource/skipRccGood.qrc | 6 ++++++ Tests/QtAutogen/skipRcc.cpp | 9 --------- Tests/QtAutogen/skipSource/skipRccBad1.qrc | 5 ----- Tests/QtAutogen/skipSource/skipRccBad2.qrc | 5 ----- Tests/QtAutogen/skipSource/skipRccGood.qrc | 6 ------ 11 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 Tests/QtAutogen/RccSkipSource/CMakeLists.txt create mode 100644 Tests/QtAutogen/RccSkipSource/skipRcc.cpp create mode 100644 Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc create mode 100644 Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc create mode 100644 Tests/QtAutogen/RccSkipSource/skipRccGood.qrc delete mode 100644 Tests/QtAutogen/skipRcc.cpp delete mode 100644 Tests/QtAutogen/skipSource/skipRccBad1.qrc delete mode 100644 Tests/QtAutogen/skipSource/skipRccBad2.qrc delete mode 100644 Tests/QtAutogen/skipSource/skipRccGood.qrc diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 317de7e..e5940d8 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -60,27 +60,6 @@ if(NON_ASCII_BDIR AND WIN32) endif() # -- Test -# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target -set(skipRccSources - skipRcc.cpp - skipSource/skipRccBad1.qrc - skipSource/skipRccBad2.qrc - skipSource/skipRccGood.qrc -) -set_property(SOURCE skipSource/skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON) -set_property(SOURCE skipSource/skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON) -# AUTORCC enabled -add_executable(skipRccA ${skipRccSources}) -set_property(TARGET skipRccA PROPERTY AUTORCC ON) -target_link_libraries(skipRccA ${QT_LIBRARIES}) -# AUTORCC, AUTOUIC and AUTOMOC enabled -add_executable(skipRccB ${skipRccSources}) -set_property(TARGET skipRccB PROPERTY AUTORCC ON) -set_property(TARGET skipRccB PROPERTY AUTOUIC ON) -set_property(TARGET skipRccB PROPERTY AUTOMOC ON) -target_link_libraries(skipRccB ${QT_LIBRARIES}) - -# -- Test # MOC AUTOMOC_MACRO_NAMES if (NOT QT_TEST_VERSION STREQUAL 4) add_subdirectory(mocMacroName) diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 2c4788b..fdf41b6 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -11,3 +11,4 @@ if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(MocSkipSource) endif() ADD_AUTOGEN_TEST(UicSkipSource) +ADD_AUTOGEN_TEST(RccSkipSource) diff --git a/Tests/QtAutogen/RccSkipSource/CMakeLists.txt b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt new file mode 100644 index 0000000..f8a8032 --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/CMakeLists.txt @@ -0,0 +1,23 @@ +cmake_minimum_required(VERSION 3.10) +project(RccSkipSource) +include("../AutogenTest.cmake") + +# Test for SKIP_AUTORCC and SKIP_AUTOGEN on an AUTORCC enabled target +set(skipRccSources + skipRcc.cpp + skipRccBad1.qrc + skipRccBad2.qrc + skipRccGood.qrc +) +set_property(SOURCE skipRccBad1.qrc PROPERTY SKIP_AUTORCC ON) +set_property(SOURCE skipRccBad2.qrc PROPERTY SKIP_AUTOGEN ON) +# AUTORCC enabled +add_executable(skipRccA ${skipRccSources}) +set_property(TARGET skipRccA PROPERTY AUTORCC ON) +target_link_libraries(skipRccA ${QT_LIBRARIES}) +# AUTORCC, AUTOUIC and AUTOMOC enabled +add_executable(skipRccB ${skipRccSources}) +set_property(TARGET skipRccB PROPERTY AUTORCC ON) +set_property(TARGET skipRccB PROPERTY AUTOUIC ON) +set_property(TARGET skipRccB PROPERTY AUTOMOC ON) +target_link_libraries(skipRccB ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/RccSkipSource/skipRcc.cpp b/Tests/QtAutogen/RccSkipSource/skipRcc.cpp new file mode 100644 index 0000000..ec57110 --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/skipRcc.cpp @@ -0,0 +1,9 @@ + +extern int qInitResources_skipRccGood(); + +int main(int, char**) +{ + // Fails to link if the symbol is not present. + qInitResources_skipRccGood(); + return 0; +} diff --git a/Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc b/Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc new file mode 100644 index 0000000..6cbd9ed --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/skipRccBad1.qrc @@ -0,0 +1,5 @@ + + + skipRccGood.cpp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + diff --git a/Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc b/Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc new file mode 100644 index 0000000..b32c589 --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/skipRccBad2.qrc @@ -0,0 +1,5 @@ +>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>< + + skipRccGood.cpp + + diff --git a/Tests/QtAutogen/RccSkipSource/skipRccGood.qrc b/Tests/QtAutogen/RccSkipSource/skipRccGood.qrc new file mode 100644 index 0000000..21a94b0 --- /dev/null +++ b/Tests/QtAutogen/RccSkipSource/skipRccGood.qrc @@ -0,0 +1,6 @@ + + + skipRccBad1.qrc + skipRccBad2.qrc + + diff --git a/Tests/QtAutogen/skipRcc.cpp b/Tests/QtAutogen/skipRcc.cpp deleted file mode 100644 index ec57110..0000000 --- a/Tests/QtAutogen/skipRcc.cpp +++ /dev/null @@ -1,9 +0,0 @@ - -extern int qInitResources_skipRccGood(); - -int main(int, char**) -{ - // Fails to link if the symbol is not present. - qInitResources_skipRccGood(); - return 0; -} diff --git a/Tests/QtAutogen/skipSource/skipRccBad1.qrc b/Tests/QtAutogen/skipSource/skipRccBad1.qrc deleted file mode 100644 index 6cbd9ed..0000000 --- a/Tests/QtAutogen/skipSource/skipRccBad1.qrc +++ /dev/null @@ -1,5 +0,0 @@ - - - skipRccGood.cpp>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> - - diff --git a/Tests/QtAutogen/skipSource/skipRccBad2.qrc b/Tests/QtAutogen/skipSource/skipRccBad2.qrc deleted file mode 100644 index b32c589..0000000 --- a/Tests/QtAutogen/skipSource/skipRccBad2.qrc +++ /dev/null @@ -1,5 +0,0 @@ ->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>< - - skipRccGood.cpp - - diff --git a/Tests/QtAutogen/skipSource/skipRccGood.qrc b/Tests/QtAutogen/skipSource/skipRccGood.qrc deleted file mode 100644 index 21a94b0..0000000 --- a/Tests/QtAutogen/skipSource/skipRccGood.qrc +++ /dev/null @@ -1,6 +0,0 @@ - - - skipRccBad1.qrc - skipRccBad2.qrc - - -- cgit v0.12