diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2017-12-08 16:29:23 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2017-12-13 12:48:27 (GMT) |
commit | 0b8597a86ee8bed2c34f52d309fd57b5f29a1595 (patch) | |
tree | 912e41e02cc0e562fca2caa9897e1e850359611b /Tests/QtAutogen/MocOnly | |
parent | 227a7974f426e0966d1736c66dd606b068985d1b (diff) | |
download | CMake-0b8597a86ee8bed2c34f52d309fd57b5f29a1595.zip CMake-0b8597a86ee8bed2c34f52d309fd57b5f29a1595.tar.gz CMake-0b8597a86ee8bed2c34f52d309fd57b5f29a1595.tar.bz2 |
Autogen: Tests: Separate mocOnly and mocOnlyOpts tests
Diffstat (limited to 'Tests/QtAutogen/MocOnly')
-rw-r--r-- | Tests/QtAutogen/MocOnly/CMakeLists.txt | 8 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleA.cpp | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleA.hpp | 17 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleB.cpp | 5 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/StyleB.hpp | 16 | ||||
-rw-r--r-- | Tests/QtAutogen/MocOnly/main.cpp | 9 |
6 files changed, 60 insertions, 0 deletions
diff --git a/Tests/QtAutogen/MocOnly/CMakeLists.txt b/Tests/QtAutogen/MocOnly/CMakeLists.txt new file mode 100644 index 0000000..33feadf --- /dev/null +++ b/Tests/QtAutogen/MocOnly/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.10) +project(MocOnly) +include("../AutogenTest.cmake") + +# Test different Q_OBJECT position styles +add_executable(mocOnly StyleA.cpp StyleB.cpp main.cpp) +set_property(TARGET mocOnly PROPERTY AUTOMOC ON) +target_link_libraries(mocOnly ${QT_LIBRARIES}) diff --git a/Tests/QtAutogen/MocOnly/StyleA.cpp b/Tests/QtAutogen/MocOnly/StyleA.cpp new file mode 100644 index 0000000..ced1dd1 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/StyleA.cpp @@ -0,0 +1,5 @@ +#include "StyleA.hpp" + +StyleA::StyleA() +{ +} diff --git a/Tests/QtAutogen/MocOnly/StyleA.hpp b/Tests/QtAutogen/MocOnly/StyleA.hpp new file mode 100644 index 0000000..5ba0a87 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/StyleA.hpp @@ -0,0 +1,17 @@ +#ifndef STYLEA_HPP +#define STYLEA_HPP + +#include <QObject> + +/* clang-format off */ +/// Q_OBJECT on a single new line +/// +class StyleA : public QObject +{ + Q_OBJECT +public: + StyleA(); +}; +/* clang-format on */ + +#endif diff --git a/Tests/QtAutogen/MocOnly/StyleB.cpp b/Tests/QtAutogen/MocOnly/StyleB.cpp new file mode 100644 index 0000000..bec6c1c --- /dev/null +++ b/Tests/QtAutogen/MocOnly/StyleB.cpp @@ -0,0 +1,5 @@ +#include "StyleB.hpp" + +StyleB::StyleB() +{ +} diff --git a/Tests/QtAutogen/MocOnly/StyleB.hpp b/Tests/QtAutogen/MocOnly/StyleB.hpp new file mode 100644 index 0000000..86abaa8 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/StyleB.hpp @@ -0,0 +1,16 @@ +#ifndef STYLEB_HPP +#define STYLEB_HPP + +#include <QObject> + +/* clang-format off */ +/// Q_OBJECT behind a brace on a new line +/// +class StyleB : public QObject +{ Q_OBJECT +public: + StyleB(); +}; +/* clang-format on */ + +#endif diff --git a/Tests/QtAutogen/MocOnly/main.cpp b/Tests/QtAutogen/MocOnly/main.cpp new file mode 100644 index 0000000..06f8d81 --- /dev/null +++ b/Tests/QtAutogen/MocOnly/main.cpp @@ -0,0 +1,9 @@ +#include "StyleA.hpp" +#include "StyleB.hpp" + +int main(int argv, char** args) +{ + StyleA styleA; + StyleB styleB; + return 0; +} |