From a2c4e3489d9ccd7150b6fda2ea7254c21dcde1b2 Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Fri, 8 Dec 2017 19:49:32 +0100 Subject: Autogen: Tests: Separate MocCMP0071 test --- Tests/QtAutogen/CMakeLists.txt | 6 ------ Tests/QtAutogen/CommonTests.cmake | 3 +++ Tests/QtAutogen/MocCMP0071/CMakeLists.txt | 6 ++++++ Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt | 16 ++++++++++++++++ Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt | 18 ++++++++++++++++++ Tests/QtAutogen/MocCMP0071/Obj.cpp | 20 ++++++++++++++++++++ Tests/QtAutogen/MocCMP0071/Obj.hpp | 19 +++++++++++++++++++ Tests/QtAutogen/MocCMP0071/Obj_p.h | 14 ++++++++++++++ Tests/QtAutogen/MocCMP0071/main.cpp | 7 +++++++ Tests/QtAutogen/mocCMP0071/CMakeLists.txt | 4 ---- Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt | 16 ---------------- Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt | 18 ------------------ Tests/QtAutogen/mocCMP0071/Obj.cpp | 20 -------------------- Tests/QtAutogen/mocCMP0071/Obj.hpp | 19 ------------------- Tests/QtAutogen/mocCMP0071/Obj_p.h | 14 -------------- Tests/QtAutogen/mocCMP0071/main.cpp | 7 ------- 16 files changed, 103 insertions(+), 104 deletions(-) create mode 100644 Tests/QtAutogen/MocCMP0071/CMakeLists.txt create mode 100644 Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt create mode 100644 Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt create mode 100644 Tests/QtAutogen/MocCMP0071/Obj.cpp create mode 100644 Tests/QtAutogen/MocCMP0071/Obj.hpp create mode 100644 Tests/QtAutogen/MocCMP0071/Obj_p.h create mode 100644 Tests/QtAutogen/MocCMP0071/main.cpp delete mode 100644 Tests/QtAutogen/mocCMP0071/CMakeLists.txt delete mode 100644 Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt delete mode 100644 Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt delete mode 100644 Tests/QtAutogen/mocCMP0071/Obj.cpp delete mode 100644 Tests/QtAutogen/mocCMP0071/Obj.hpp delete mode 100644 Tests/QtAutogen/mocCMP0071/Obj_p.h delete mode 100644 Tests/QtAutogen/mocCMP0071/main.cpp diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt index 5775117..1f50931 100644 --- a/Tests/QtAutogen/CMakeLists.txt +++ b/Tests/QtAutogen/CMakeLists.txt @@ -60,12 +60,6 @@ if(NON_ASCII_BDIR AND WIN32) endif() # -- Test -# Tests policy 0071 -if(ALLOW_WRAP_CPP) - add_subdirectory(mocCMP0071) -endif() - -# -- Test # Tests various .ui include directories add_subdirectory(uicInclude) diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake index 4d89eae..932169b 100644 --- a/Tests/QtAutogen/CommonTests.cmake +++ b/Tests/QtAutogen/CommonTests.cmake @@ -20,3 +20,6 @@ if(QT_TEST_ALLOW_QT_MACROS) ADD_AUTOGEN_TEST(MocIncludeStrict mocIncludeStrict) ADD_AUTOGEN_TEST(MocIncludeRelaxed mocIncludeRelaxed) endif() +if(QT_TEST_ALLOW_QT_MACROS) + ADD_AUTOGEN_TEST(MocCMP0071) +endif() diff --git a/Tests/QtAutogen/MocCMP0071/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt new file mode 100644 index 0000000..a79f36e --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.10) +project(MocCMP0071) +include("../AutogenTest.cmake") + +add_subdirectory(OLD) +add_subdirectory(NEW) diff --git a/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt new file mode 100644 index 0000000..954fe3d --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/NEW/CMakeLists.txt @@ -0,0 +1,16 @@ +cmake_minimum_required(VERSION 3.10) +cmake_policy(SET CMP0071 NEW) + +# *Generate* files +set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) +set(CBD ${CMAKE_CURRENT_BINARY_DIR}) +add_custom_command( + OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp) + +add_executable(mocCMP0071New ${CBD}/Obj.cpp ${CBD}/main.cpp) +target_link_libraries(mocCMP0071New ${QT_LIBRARIES}) +set_target_properties(mocCMP0071New PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt new file mode 100644 index 0000000..68fa067 --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/OLD/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.10) +cmake_policy(SET CMP0071 OLD) + +# *Generate* files +set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) +set(CBD ${CMAKE_CURRENT_BINARY_DIR}) +add_custom_command( + OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp + COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp) + +# Generate moc files externally +qtx_wrap_cpp(mocCMP0071OldMoc ${CBD}/Obj.hpp ${CBD}/Obj_p.h) +add_executable(mocCMP0071Old ${CBD}/Obj.cpp ${CBD}/main.cpp ${mocCMP0071OldMoc}) +target_link_libraries(mocCMP0071Old ${QT_LIBRARIES}) +set_target_properties(mocCMP0071Old PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/MocCMP0071/Obj.cpp b/Tests/QtAutogen/MocCMP0071/Obj.cpp new file mode 100644 index 0000000..1ae50ed --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/Obj.cpp @@ -0,0 +1,20 @@ +#include "Obj.hpp" +#include "Obj_p.h" + +ObjPrivate::ObjPrivate() +{ +} + +ObjPrivate::~ObjPrivate() +{ +} + +Obj::Obj() + : d(new ObjPrivate) +{ +} + +Obj::~Obj() +{ + delete d; +} diff --git a/Tests/QtAutogen/MocCMP0071/Obj.hpp b/Tests/QtAutogen/MocCMP0071/Obj.hpp new file mode 100644 index 0000000..f064e47 --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/Obj.hpp @@ -0,0 +1,19 @@ +#ifndef OBJ_HPP +#define OBJ_HPP + +#include + +// Object source comes without any _moc/.moc includes +class ObjPrivate; +class Obj : public QObject +{ + Q_OBJECT +public: + Obj(); + ~Obj(); + +private: + ObjPrivate* const d; +}; + +#endif diff --git a/Tests/QtAutogen/MocCMP0071/Obj_p.h b/Tests/QtAutogen/MocCMP0071/Obj_p.h new file mode 100644 index 0000000..cb1e5df --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/Obj_p.h @@ -0,0 +1,14 @@ +#ifndef OBJ_P_HPP +#define OBJ_P_HPP + +#include + +class ObjPrivate : public QObject +{ + Q_OBJECT +public: + ObjPrivate(); + ~ObjPrivate(); +}; + +#endif diff --git a/Tests/QtAutogen/MocCMP0071/main.cpp b/Tests/QtAutogen/MocCMP0071/main.cpp new file mode 100644 index 0000000..3887840 --- /dev/null +++ b/Tests/QtAutogen/MocCMP0071/main.cpp @@ -0,0 +1,7 @@ +#include "Obj.hpp" + +int main(int argv, char** args) +{ + Obj obj; + return 0; +} diff --git a/Tests/QtAutogen/mocCMP0071/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/CMakeLists.txt deleted file mode 100644 index 003fa08..0000000 --- a/Tests/QtAutogen/mocCMP0071/CMakeLists.txt +++ /dev/null @@ -1,4 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(mocCMP0071 CXX) -add_subdirectory(OLD) -add_subdirectory(NEW) diff --git a/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt deleted file mode 100644 index 0237afc..0000000 --- a/Tests/QtAutogen/mocCMP0071/NEW/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 NEW) - -# *Generate* files -set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) -set(CBD ${CMAKE_CURRENT_BINARY_DIR}) -add_custom_command( - OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp) - -add_executable(mocCMP0071New ${CBD}/Obj.cpp ${CBD}/main.cpp) -target_link_libraries(mocCMP0071New ${QT_LIBRARIES}) -set_target_properties(mocCMP0071New PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt b/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt deleted file mode 100644 index 5699433..0000000 --- a/Tests/QtAutogen/mocCMP0071/OLD/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -cmake_policy(SET CMP0071 OLD) - -# *Generate* files -set(CSD ${CMAKE_CURRENT_SOURCE_DIR}) -set(CBD ${CMAKE_CURRENT_BINARY_DIR}) -add_custom_command( - OUTPUT ${CBD}/Obj_p.h ${CBD}/Obj.hpp ${CBD}/Obj.cpp ${CBD}/main.cpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj_p.h ${CBD}/Obj_p.h - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.hpp ${CBD}/Obj.hpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../Obj.cpp ${CBD}/Obj.cpp - COMMAND ${CMAKE_COMMAND} -E copy ${CSD}/../main.cpp ${CBD}/main.cpp) - -# Generate moc files externally -qtx_wrap_cpp(mocCMP0071OldMoc ${CBD}/Obj.hpp ${CBD}/Obj_p.h) -add_executable(mocCMP0071Old ${CBD}/Obj.cpp ${CBD}/main.cpp ${mocCMP0071OldMoc}) -target_link_libraries(mocCMP0071Old ${QT_LIBRARIES}) -set_target_properties(mocCMP0071Old PROPERTIES AUTOMOC ON) diff --git a/Tests/QtAutogen/mocCMP0071/Obj.cpp b/Tests/QtAutogen/mocCMP0071/Obj.cpp deleted file mode 100644 index 1ae50ed..0000000 --- a/Tests/QtAutogen/mocCMP0071/Obj.cpp +++ /dev/null @@ -1,20 +0,0 @@ -#include "Obj.hpp" -#include "Obj_p.h" - -ObjPrivate::ObjPrivate() -{ -} - -ObjPrivate::~ObjPrivate() -{ -} - -Obj::Obj() - : d(new ObjPrivate) -{ -} - -Obj::~Obj() -{ - delete d; -} diff --git a/Tests/QtAutogen/mocCMP0071/Obj.hpp b/Tests/QtAutogen/mocCMP0071/Obj.hpp deleted file mode 100644 index f064e47..0000000 --- a/Tests/QtAutogen/mocCMP0071/Obj.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef OBJ_HPP -#define OBJ_HPP - -#include - -// Object source comes without any _moc/.moc includes -class ObjPrivate; -class Obj : public QObject -{ - Q_OBJECT -public: - Obj(); - ~Obj(); - -private: - ObjPrivate* const d; -}; - -#endif diff --git a/Tests/QtAutogen/mocCMP0071/Obj_p.h b/Tests/QtAutogen/mocCMP0071/Obj_p.h deleted file mode 100644 index cb1e5df..0000000 --- a/Tests/QtAutogen/mocCMP0071/Obj_p.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef OBJ_P_HPP -#define OBJ_P_HPP - -#include - -class ObjPrivate : public QObject -{ - Q_OBJECT -public: - ObjPrivate(); - ~ObjPrivate(); -}; - -#endif diff --git a/Tests/QtAutogen/mocCMP0071/main.cpp b/Tests/QtAutogen/mocCMP0071/main.cpp deleted file mode 100644 index 3887840..0000000 --- a/Tests/QtAutogen/mocCMP0071/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "Obj.hpp" - -int main(int argv, char** args) -{ - Obj obj; - return 0; -} -- cgit v0.12