diff options
Diffstat (limited to 'Tests/QtAutogenRerun')
23 files changed, 0 insertions, 285 deletions
diff --git a/Tests/QtAutogenRerun/CMakeLists.txt b/Tests/QtAutogenRerun/CMakeLists.txt index 746ba4a..9f1ee28 100644 --- a/Tests/QtAutogenRerun/CMakeLists.txt +++ b/Tests/QtAutogenRerun/CMakeLists.txt @@ -40,10 +40,4 @@ endif() add_executable(dummy dummy.cpp) # -- Test -# Tests Q_PLUGIN_METADATA json file change detection -if (NOT QT_TEST_VERSION STREQUAL 4) - include("mocPlugin.cmake") -endif() - -# -- Test include("rccDepends.cmake") diff --git a/Tests/QtAutogenRerun/mocPlugin.cmake b/Tests/QtAutogenRerun/mocPlugin.cmake deleted file mode 100644 index 7ad5ccb..0000000 --- a/Tests/QtAutogenRerun/mocPlugin.cmake +++ /dev/null @@ -1,96 +0,0 @@ - -# Utility variables -set(timeformat "%Y%j%H%M%S") -set(mocPlugSrcDir "${CMAKE_CURRENT_SOURCE_DIR}/mocPlugin") -set(mocPlugBinDir "${CMAKE_CURRENT_BINARY_DIR}/mocPlugin") - -# Initial buid -try_compile(MOC_PLUGIN - "${mocPlugBinDir}" - "${mocPlugSrcDir}" - mocPlugin - CMAKE_FLAGS "-DQT_TEST_VERSION=${QT_TEST_VERSION}" - "-DCMAKE_PREFIX_PATH=${Qt_PREFIX_DIR}" - OUTPUT_VARIABLE output -) -if (NOT MOC_PLUGIN) - message(SEND_ERROR "Initial build of mocPlugin failed. Output: ${output}") -endif() - -find_library(plAFile "PlugA" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) -find_library(plBFile "PlugB" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) -find_library(plCFile "PlugC" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) -find_library(plDFile "PlugD" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) -find_library(plEFile "PlugE" PATHS "${mocPlugBinDir}/Debug" "${mocPlugBinDir}" NO_DEFAULT_PATH) - -# - Ensure that the timestamp will change. -# - Change the json files referenced by Q_PLUGIN_METADATA -# - Rebuild -file(TIMESTAMP "${plAFile}" plABefore "${timeformat}") -file(TIMESTAMP "${plBFile}" plBBefore "${timeformat}") -file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}") -file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}") -file(TIMESTAMP "${plEFile}" plEBefore "${timeformat}") - -execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) -configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleC.json") -configure_file("${mocPlugSrcDir}/jsonIn/StyleE.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD.json") -configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/StyleE.json") -execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}") - -file(TIMESTAMP "${plAFile}" plAAfter "${timeformat}") -file(TIMESTAMP "${plBFile}" plBAfter "${timeformat}") -file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}") -file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}") -file(TIMESTAMP "${plEFile}" plEAfter "${timeformat}") - -if (plAAfter GREATER plABefore) - message(SEND_ERROR "file (${plAFile}) should not have changed!") -endif() -if (plBAfter GREATER plBBefore) - message(SEND_ERROR "file (${plBFile}) should not have changed!") -endif() -if (NOT plCAfter GREATER plCBefore) - message(SEND_ERROR "file (${plCFile}) should have changed!") -endif() -if (NOT plDAfter GREATER plDBefore) - message(SEND_ERROR "file (${plDFile}) should have changed!") -endif() -if (NOT plEAfter GREATER plEBefore) - # There's a bug in Ninja on Windows - # https://gitlab.kitware.com/cmake/cmake/issues/16776 - if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja")) - message(SEND_ERROR "file (${plEFile}) should have changed!") - endif() -endif() - -# - Ensure that the timestamp will change. -# - Change the json files referenced by A_CUSTOM_MACRO -# - Rebuild -file(TIMESTAMP "${plCFile}" plCBefore "${timeformat}") -file(TIMESTAMP "${plDFile}" plDBefore "${timeformat}") -file(TIMESTAMP "${plEFile}" plEBefore "${timeformat}") - -execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 1) -configure_file("${mocPlugSrcDir}/jsonIn/StyleE.json" "${mocPlugBinDir}/jsonFiles/StyleC_Custom.json") -configure_file("${mocPlugSrcDir}/jsonIn/StyleC.json" "${mocPlugBinDir}/jsonFiles/sub/StyleD_Custom.json") -configure_file("${mocPlugSrcDir}/jsonIn/StyleD.json" "${mocPlugBinDir}/jsonFiles/StyleE_Custom.json") -execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${mocPlugBinDir}") - -file(TIMESTAMP "${plCFile}" plCAfter "${timeformat}") -file(TIMESTAMP "${plDFile}" plDAfter "${timeformat}") -file(TIMESTAMP "${plEFile}" plEAfter "${timeformat}") - -if (NOT plCAfter GREATER plCBefore) - message(SEND_ERROR "file (${plCFile}) should have changed!") -endif() -if (NOT plDAfter GREATER plDBefore) - message(SEND_ERROR "file (${plDFile}) should have changed!") -endif() -if (NOT plEAfter GREATER plEBefore) - # There's a bug in Ninja on Windows - # https://gitlab.kitware.com/cmake/cmake/issues/16776 - if(NOT ("${CMAKE_GENERATOR}" MATCHES "Ninja")) - message(SEND_ERROR "file (${plEFile}) should have changed!") - endif() -endif() diff --git a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt b/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt deleted file mode 100644 index b7cc5e9..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(mocPlugin CXX) - -set(CMAKE_AUTOMOC_DEPEND_FILTERS - "A_CUSTOM_MACRO" - "[\n][ \t]*A_CUSTOM_MACRO[ \t\r\n]*\\([^,]+,[ \t\r\n]*\"([^\"]+)\"" - ) - -if (NOT QT_TEST_VERSION STREQUAL 5) - message(SEND_ERROR "Invalid Qt version specified.") -endif() -find_package(Qt5Widgets REQUIRED) - -if(Qt5_POSITION_INDEPENDENT_CODE AND CMAKE_CXX_COMPILE_OPTIONS_PIC) - add_definitions(${CMAKE_CXX_COMPILE_OPTIONS_PIC}) -endif() - -configure_file(jsonIn/StyleC.json jsonFiles/StyleC.json) -configure_file(jsonIn/StyleC.json jsonFiles/StyleC_Custom.json) -configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD.json) -configure_file(jsonIn/StyleD.json jsonFiles/sub/StyleD_Custom.json) -configure_file(jsonIn/StyleE.json jsonFiles/StyleE.json) -configure_file(jsonIn/StyleE.json jsonFiles/StyleE_Custom.json) - -# Enable automoc -set(CMAKE_AUTOMOC TRUE) - -include_directories("${CMAKE_CURRENT_BINARY_DIR}/jsonFiles") -link_libraries(Qt5::Widgets) - -add_library(PlugA STATIC StyleA.cpp) -add_library(PlugB STATIC StyleB.cpp) -add_library(PlugC STATIC StyleC.cpp) -add_library(PlugD STATIC StyleD.cpp) -add_library(PlugE STATIC StyleE.cpp) diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp deleted file mode 100644 index b5e8753..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StyleA.hpp" - -QStyle* StyleA::create(const QString& key) -{ - return 0; -} diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp deleted file mode 100644 index 35158a4..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef STYLEA_HPP -#define STYLEA_HPP - -#include "UtilityMacros.hpp" -#include <QStylePlugin> - -class StyleA : public QStylePlugin -{ - Q_OBJECT - // Json file in source local directory - Q_PLUGIN_METADATA(IID "org.styles.A" FILE "StyleA.json") - A_CUSTOM_MACRO(SomeArg, "StyleA_Custom.json", AnotherArg) -public: - QStyle* create(const QString& key); -}; - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA.json b/Tests/QtAutogenRerun/mocPlugin/StyleA.json deleted file mode 100644 index cc33953..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json b/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json deleted file mode 100644 index cc33953..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleA_Custom.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Rocket", "Starbuster" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp deleted file mode 100644 index 17d4400..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleB.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StyleB.hpp" - -QStyle* StyleB::create(const QString& key) -{ - return 0; -} diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp deleted file mode 100644 index 15b79c5..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleB.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef STYLEB_HPP -#define STYLEB_HPP - -#include "UtilityMacros.hpp" -#include <QStylePlugin> - -class StyleB : public QStylePlugin -{ - Q_OBJECT - // Json file in source local subdirectory - Q_PLUGIN_METADATA(IID "org.styles.B" FILE "jsonIn/StyleB.json") - A_CUSTOM_MACRO(SomeArg, "jsonIn/StyleB_Custom.json", AnotherArg) -public: - QStyle* create(const QString& key); -}; - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp deleted file mode 100644 index 37e7564..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleC.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StyleC.hpp" - -QStyle* StyleC::create(const QString& key) -{ - return 0; -} diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp deleted file mode 100644 index b0a4115..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleC.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef STYLEC_HPP -#define STYLEC_HPP - -#include "UtilityMacros.hpp" -#include <QStylePlugin> - -class StyleC : public QStylePlugin -{ - Q_OBJECT - // Json file in global root directory - Q_PLUGIN_METADATA(IID "org.styles.C" FILE "StyleC.json") - A_CUSTOM_MACRO(SomeArg, "StyleC_Custom.json", AnotherArg) -public: - QStyle* create(const QString& key); -}; - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp deleted file mode 100644 index 7e4b121..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleD.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StyleD.hpp" - -QStyle* StyleD::create(const QString& key) -{ - return 0; -} diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp deleted file mode 100644 index 9696aaa..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleD.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef STYLED_HPP -#define STYLED_HPP - -#include "UtilityMacros.hpp" -#include <QStylePlugin> - -class StyleD : public QStylePlugin -{ - Q_OBJECT - // Json file in global sub director - Q_PLUGIN_METADATA(IID "org.styles.D" FILE "sub/StyleD.json") - A_CUSTOM_MACRO(SomeArg, "sub/StyleD_Custom.json", AnotherArg) -public: - QStyle* create(const QString& key); -}; - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp deleted file mode 100644 index 3448319..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleE.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "StyleE.hpp" - -QStyle* StyleE::create(const QString& key) -{ - return 0; -} - -// AUTOMOC the StyleEInclude.hpp header -#include "moc_StyleEInclude.cpp" diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp deleted file mode 100644 index a069034..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleE.hpp +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef STYLEE_HPP -#define STYLEE_HPP - -// The included file is not in the sources list and won't be detected by -// AUTOMOC source file with the same base name. -// It is registered to AUTOMOCed via a moc_<NAME>.cpp include in StyleE.cpp -// though. -#include "StyleEInclude.hpp" - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp b/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp deleted file mode 100644 index f9734db..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/StyleEInclude.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef STYLEE_INCLUDE_HPP -#define STYLEE_INCLUDE_HPP - -#include "UtilityMacros.hpp" -#include <QStylePlugin> - -class StyleE : public QStylePlugin -{ - Q_OBJECT - // Json files in global root directory - Q_PLUGIN_METADATA(IID "org.styles.E" FILE "StyleE.json") - A_CUSTOM_MACRO(SomeArg, "StyleE_Custom.json", AnotherArg) -public: - QStyle* create(const QString& key); -}; - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp b/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp deleted file mode 100644 index 53a4284..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/UtilityMacros.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef UTILITYMACROS_HPP -#define UTILITYMACROS_HPP - -// Empty test macro definition -#define A_CUSTOM_MACRO(name, jsonFile, pluginRegistrations) - -#endif diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json deleted file mode 100644 index cd155dc..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Red", "Green" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json deleted file mode 100644 index 129cac4..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleB_Custom.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Rocket", "StarbusterB" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json deleted file mode 100644 index 119aaa4..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleC.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Boat", "Ship" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json deleted file mode 100644 index 732c547..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleD.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Bike", "Car" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json b/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json deleted file mode 100644 index 5412c94..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/jsonIn/StyleE.json +++ /dev/null @@ -1 +0,0 @@ -{ "Keys": [ "Floor", "Ceiling" ] } diff --git a/Tests/QtAutogenRerun/mocPlugin/main.cpp b/Tests/QtAutogenRerun/mocPlugin/main.cpp deleted file mode 100644 index 3ba2ddc..0000000 --- a/Tests/QtAutogenRerun/mocPlugin/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "StyleA.hpp" - -int main(int argv, char** args) -{ - return 0; -} |