summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-12-08 18:15:26 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-12-13 12:48:28 (GMT)
commitfb7e52ca3d920ca1de8b2abb23da3d83db988eca (patch)
tree5115b6cc960afe715352af9985186fc94eebbdce /Tests/QtAutogen
parent5cab8c307c7df585152e3ab9e007574cb0e690dc (diff)
downloadCMake-fb7e52ca3d920ca1de8b2abb23da3d83db988eca.zip
CMake-fb7e52ca3d920ca1de8b2abb23da3d83db988eca.tar.gz
CMake-fb7e52ca3d920ca1de8b2abb23da3d83db988eca.tar.bz2
Autogen: Tests: Separate MocMacroName test
Diffstat (limited to 'Tests/QtAutogen')
-rw-r--r--Tests/QtAutogen/CMakeLists.txt6
-rw-r--r--Tests/QtAutogen/CommonTests.cmake3
-rw-r--r--Tests/QtAutogen/MocMacroName/CMakeLists.txt17
-rw-r--r--Tests/QtAutogen/MocMacroName/CustomMacros.hpp (renamed from Tests/QtAutogen/mocMacroName/CustomMacros.hpp)0
-rw-r--r--Tests/QtAutogen/MocMacroName/Gadget.cpp (renamed from Tests/QtAutogen/mocMacroName/Gadget.cpp)2
-rw-r--r--Tests/QtAutogen/MocMacroName/Gadget.hpp (renamed from Tests/QtAutogen/mocMacroName/Gadget.hpp)8
-rw-r--r--Tests/QtAutogen/MocMacroName/Object.cpp (renamed from Tests/QtAutogen/mocMacroName/Object.cpp)1
-rw-r--r--Tests/QtAutogen/MocMacroName/Object.hpp (renamed from Tests/QtAutogen/mocMacroName/Object.hpp)7
-rw-r--r--Tests/QtAutogen/MocMacroName/Object1Aliased.cpp (renamed from Tests/QtAutogen/mocMacroName/Object1Aliased.cpp)0
-rw-r--r--Tests/QtAutogen/MocMacroName/Object1Aliased.hpp (renamed from Tests/QtAutogen/mocMacroName/Object1Aliased.hpp)0
-rw-r--r--Tests/QtAutogen/MocMacroName/Object2Aliased.cpp (renamed from Tests/QtAutogen/mocMacroName/Object2Aliased.cpp)0
-rw-r--r--Tests/QtAutogen/MocMacroName/Object2Aliased.hpp (renamed from Tests/QtAutogen/mocMacroName/Object2Aliased.hpp)0
-rw-r--r--Tests/QtAutogen/MocMacroName/main.cpp (renamed from Tests/QtAutogen/mocMacroName/main.cpp)0
-rw-r--r--Tests/QtAutogen/mocMacroName/CMakeLists.txt8
14 files changed, 33 insertions, 19 deletions
diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index e5940d8..6b54b1a 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -60,12 +60,6 @@ if(NON_ASCII_BDIR AND WIN32)
endif()
# -- Test
-# MOC AUTOMOC_MACRO_NAMES
-if (NOT QT_TEST_VERSION STREQUAL 4)
- add_subdirectory(mocMacroName)
-endif()
-
-# -- Test
# Tests AUTOMOC with generated sources
add_subdirectory(mocDepends)
diff --git a/Tests/QtAutogen/CommonTests.cmake b/Tests/QtAutogen/CommonTests.cmake
index fdf41b6..6a92873 100644
--- a/Tests/QtAutogen/CommonTests.cmake
+++ b/Tests/QtAutogen/CommonTests.cmake
@@ -12,3 +12,6 @@ if(QT_TEST_ALLOW_QT_MACROS)
endif()
ADD_AUTOGEN_TEST(UicSkipSource)
ADD_AUTOGEN_TEST(RccSkipSource)
+if(NOT QT_TEST_VERSION STREQUAL 4)
+ ADD_AUTOGEN_TEST(MocMacroName mocMacroName)
+endif()
diff --git a/Tests/QtAutogen/MocMacroName/CMakeLists.txt b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
new file mode 100644
index 0000000..f0251a2
--- /dev/null
+++ b/Tests/QtAutogen/MocMacroName/CMakeLists.txt
@@ -0,0 +1,17 @@
+cmake_minimum_required(VERSION 3.10)
+project(MocMacroName)
+include("../AutogenTest.cmake")
+
+# Test CMAKE_AUTOMOC_MACRO_NAMES and AUTOMOC_MACRO_NAMES
+list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS")
+
+add_executable(mocMacroName
+ main.cpp
+ Gadget.cpp
+ Object.cpp
+ Object1Aliased.cpp
+ Object2Aliased.cpp
+)
+set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
+set_property(TARGET mocMacroName APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS")
+target_link_libraries(mocMacroName ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp b/Tests/QtAutogen/MocMacroName/CustomMacros.hpp
index 93e5bfd..93e5bfd 100644
--- a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp
+++ b/Tests/QtAutogen/MocMacroName/CustomMacros.hpp
diff --git a/Tests/QtAutogen/mocMacroName/Gadget.cpp b/Tests/QtAutogen/MocMacroName/Gadget.cpp
index 167faeb..d7cb515 100644
--- a/Tests/QtAutogen/mocMacroName/Gadget.cpp
+++ b/Tests/QtAutogen/MocMacroName/Gadget.cpp
@@ -1,6 +1,6 @@
#include "Gadget.hpp"
Gadget::Gadget()
- : test(0)
+ : _test(0)
{
}
diff --git a/Tests/QtAutogen/mocMacroName/Gadget.hpp b/Tests/QtAutogen/MocMacroName/Gadget.hpp
index 2587ed2..cab792e 100644
--- a/Tests/QtAutogen/mocMacroName/Gadget.hpp
+++ b/Tests/QtAutogen/MocMacroName/Gadget.hpp
@@ -6,10 +6,14 @@
class Gadget
{
Q_GADGET
- Q_PROPERTY(int test MEMBER test)
+ Q_PROPERTY(int test READ getTest)
public:
Gadget();
- int test;
+
+ int getTest() { return _test; }
+
+private:
+ int _test;
};
#endif
diff --git a/Tests/QtAutogen/mocMacroName/Object.cpp b/Tests/QtAutogen/MocMacroName/Object.cpp
index c0b4f33..800ebf3 100644
--- a/Tests/QtAutogen/mocMacroName/Object.cpp
+++ b/Tests/QtAutogen/MocMacroName/Object.cpp
@@ -1,6 +1,7 @@
#include "Object.hpp"
Object::Object()
+ : _test(0)
{
}
diff --git a/Tests/QtAutogen/mocMacroName/Object.hpp b/Tests/QtAutogen/MocMacroName/Object.hpp
index 0c40824..aadae1f 100644
--- a/Tests/QtAutogen/mocMacroName/Object.hpp
+++ b/Tests/QtAutogen/MocMacroName/Object.hpp
@@ -6,14 +6,17 @@
class Object : public QObject
{
Q_OBJECT
- Q_PROPERTY(int test MEMBER test)
+ Q_PROPERTY(int test READ getTest)
public:
Object();
+ int getTest() { return _test; }
+
Q_SLOT
void aSlot();
- int test;
+private:
+ int _test;
};
#endif
diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp b/Tests/QtAutogen/MocMacroName/Object1Aliased.cpp
index b8b4806..b8b4806 100644
--- a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp
+++ b/Tests/QtAutogen/MocMacroName/Object1Aliased.cpp
diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp b/Tests/QtAutogen/MocMacroName/Object1Aliased.hpp
index 6c6bb40..6c6bb40 100644
--- a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp
+++ b/Tests/QtAutogen/MocMacroName/Object1Aliased.hpp
diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp b/Tests/QtAutogen/MocMacroName/Object2Aliased.cpp
index 4b09dd1..4b09dd1 100644
--- a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp
+++ b/Tests/QtAutogen/MocMacroName/Object2Aliased.cpp
diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp b/Tests/QtAutogen/MocMacroName/Object2Aliased.hpp
index b9bdc12..b9bdc12 100644
--- a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp
+++ b/Tests/QtAutogen/MocMacroName/Object2Aliased.hpp
diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/MocMacroName/main.cpp
index 3b45d04..3b45d04 100644
--- a/Tests/QtAutogen/mocMacroName/main.cpp
+++ b/Tests/QtAutogen/MocMacroName/main.cpp
diff --git a/Tests/QtAutogen/mocMacroName/CMakeLists.txt b/Tests/QtAutogen/mocMacroName/CMakeLists.txt
deleted file mode 100644
index 08e6803..0000000
--- a/Tests/QtAutogen/mocMacroName/CMakeLists.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-cmake_minimum_required(VERSION 3.9)
-
-list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS")
-
-add_executable(mmn main.cpp Gadget.cpp Object.cpp Object1Aliased.cpp Object2Aliased.cpp)
-set_property(TARGET mmn PROPERTY AUTOMOC ON)
-set_property(TARGET mmn APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS")
-target_link_libraries(mmn ${QT_LIBRARIES})