mirror of
https://github.com/Kitware/CMake.git
synced 2026-07-12 02:24:39 +00:00
Autogen: Tests: Add AUTOGEN_PARALLEL tests
This commit is contained in:
@@ -29,6 +29,12 @@ ADD_AUTOGEN_TEST(ObjectLibrary someProgram)
|
||||
if(APPLE AND (NOT QT_TEST_VERSION STREQUAL 4))
|
||||
ADD_AUTOGEN_TEST(MacOsFW)
|
||||
endif()
|
||||
ADD_AUTOGEN_TEST(Parallel parallel)
|
||||
ADD_AUTOGEN_TEST(Parallel1 parallel1)
|
||||
ADD_AUTOGEN_TEST(Parallel2 parallel2)
|
||||
ADD_AUTOGEN_TEST(Parallel3 parallel3)
|
||||
ADD_AUTOGEN_TEST(Parallel4 parallel4)
|
||||
ADD_AUTOGEN_TEST(ParallelAUTO parallelAUTO)
|
||||
ADD_AUTOGEN_TEST(SameName sameName)
|
||||
ADD_AUTOGEN_TEST(StaticLibraryCycle slc)
|
||||
ADD_AUTOGEN_TEST(Complex QtAutogen)
|
||||
|
||||
10
Tests/QtAutogen/Parallel/CMakeLists.txt
Normal file
10
Tests/QtAutogen/Parallel/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Parallel)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallel ${PARALLEL_SRC})
|
||||
set_target_properties(parallel PROPERTIES AUTOGEN_PARALLEL "")
|
||||
target_link_libraries(parallel ${QT_LIBRARIES})
|
||||
6
Tests/QtAutogen/Parallel/aaa/bbb/data.qrc
Normal file
6
Tests/QtAutogen/Parallel/aaa/bbb/data.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="aaa/bbb">
|
||||
<file>item.hpp</file>
|
||||
<file>item.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
22
Tests/QtAutogen/Parallel/aaa/bbb/item.cpp
Normal file
22
Tests/QtAutogen/Parallel/aaa/bbb/item.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "item.hpp"
|
||||
|
||||
namespace aaa {
|
||||
namespace bbb {
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
MocLocal obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "aaa/bbb/item.moc"
|
||||
18
Tests/QtAutogen/Parallel/aaa/bbb/item.hpp
Normal file
18
Tests/QtAutogen/Parallel/aaa/bbb/item.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef AAA_BBB_ITEM_HPP
|
||||
#define AAA_BBB_ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace aaa {
|
||||
namespace bbb {
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
6
Tests/QtAutogen/Parallel/aaa/data.qrc
Normal file
6
Tests/QtAutogen/Parallel/aaa/data.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="aaa/">
|
||||
<file>item.hpp</file>
|
||||
<file>item.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
22
Tests/QtAutogen/Parallel/aaa/item.cpp
Normal file
22
Tests/QtAutogen/Parallel/aaa/item.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "item.hpp"
|
||||
// Include ui_view.h only in header
|
||||
|
||||
namespace aaa {
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
Ui_ViewAAA ui;
|
||||
MocLocal obj;
|
||||
}
|
||||
}
|
||||
|
||||
#include "aaa/item.moc"
|
||||
18
Tests/QtAutogen/Parallel/aaa/item.hpp
Normal file
18
Tests/QtAutogen/Parallel/aaa/item.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef AAA_ITEM_HPP
|
||||
#define AAA_ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
// Include ui_view.h only in header
|
||||
#include <aaa/ui_view.h>
|
||||
|
||||
namespace aaa {
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
24
Tests/QtAutogen/Parallel/aaa/view.ui
Normal file
24
Tests/QtAutogen/Parallel/aaa/view.ui
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewAAA</class>
|
||||
<widget class="QWidget" name="Base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
6
Tests/QtAutogen/Parallel/bbb/aaa/data.qrc
Normal file
6
Tests/QtAutogen/Parallel/bbb/aaa/data.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="bbb/aaa/">
|
||||
<file>item.hpp</file>
|
||||
<file>item.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
22
Tests/QtAutogen/Parallel/bbb/aaa/item.cpp
Normal file
22
Tests/QtAutogen/Parallel/bbb/aaa/item.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "item.hpp"
|
||||
|
||||
namespace bbb {
|
||||
namespace aaa {
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
MocLocal obj;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include "bbb/aaa/item.moc"
|
||||
18
Tests/QtAutogen/Parallel/bbb/aaa/item.hpp
Normal file
18
Tests/QtAutogen/Parallel/bbb/aaa/item.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef BBB_AAA_ITEM_HPP
|
||||
#define BBB_AAA_ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
namespace bbb {
|
||||
namespace aaa {
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
6
Tests/QtAutogen/Parallel/bbb/data.qrc
Normal file
6
Tests/QtAutogen/Parallel/bbb/data.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="bbb/">
|
||||
<file>item.hpp</file>
|
||||
<file>item.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
23
Tests/QtAutogen/Parallel/bbb/item.cpp
Normal file
23
Tests/QtAutogen/Parallel/bbb/item.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "item.hpp"
|
||||
// Include ui_view.h only in source
|
||||
#include <bbb/ui_view.h>
|
||||
|
||||
namespace bbb {
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
Ui_ViewBBB ui;
|
||||
MocLocal obj;
|
||||
}
|
||||
}
|
||||
|
||||
#include "bbb/item.moc"
|
||||
17
Tests/QtAutogen/Parallel/bbb/item.hpp
Normal file
17
Tests/QtAutogen/Parallel/bbb/item.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef BBB_ITEM_HPP
|
||||
#define BBB_ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
// Include ui_view.h only in source
|
||||
|
||||
namespace bbb {
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
24
Tests/QtAutogen/Parallel/bbb/view.ui
Normal file
24
Tests/QtAutogen/Parallel/bbb/view.ui
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewBBB</class>
|
||||
<widget class="QWidget" name="Base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
6
Tests/QtAutogen/Parallel/ccc/data.qrc
Normal file
6
Tests/QtAutogen/Parallel/ccc/data.qrc
Normal file
@@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="ccc/">
|
||||
<file>item.hpp</file>
|
||||
<file>item.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
25
Tests/QtAutogen/Parallel/ccc/item.cpp
Normal file
25
Tests/QtAutogen/Parallel/ccc/item.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#include "item.hpp"
|
||||
// Include ui_view.h in source and header
|
||||
#include <ccc/ui_view.h>
|
||||
|
||||
namespace ccc {
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
Ui_ViewCCC ui;
|
||||
MocLocal obj;
|
||||
}
|
||||
}
|
||||
|
||||
// Include own moc files
|
||||
#include "ccc/item.moc"
|
||||
#include "moc_item.cpp"
|
||||
18
Tests/QtAutogen/Parallel/ccc/item.hpp
Normal file
18
Tests/QtAutogen/Parallel/ccc/item.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef CCC_ITEM_HPP
|
||||
#define CCC_ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
// Include ui_view.h in source and header
|
||||
#include <ccc/ui_view.h>
|
||||
|
||||
namespace ccc {
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
24
Tests/QtAutogen/Parallel/ccc/view.ui
Normal file
24
Tests/QtAutogen/Parallel/ccc/view.ui
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ViewCCC</class>
|
||||
<widget class="QWidget" name="Base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
5
Tests/QtAutogen/Parallel/data.qrc
Normal file
5
Tests/QtAutogen/Parallel/data.qrc
Normal file
@@ -0,0 +1,5 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>main.cpp</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
20
Tests/QtAutogen/Parallel/item.cpp
Normal file
20
Tests/QtAutogen/Parallel/item.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "item.hpp"
|
||||
// Include ui_view.h in source and header
|
||||
#include <ui_view.h>
|
||||
|
||||
class MocLocal : public QObject
|
||||
{
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
MocLocal() = default;
|
||||
~MocLocal() = default;
|
||||
};
|
||||
|
||||
void Item::go()
|
||||
{
|
||||
Ui_View ui;
|
||||
MocLocal obj;
|
||||
}
|
||||
|
||||
#include "item.moc"
|
||||
15
Tests/QtAutogen/Parallel/item.hpp
Normal file
15
Tests/QtAutogen/Parallel/item.hpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef ITEM_HPP
|
||||
#define ITEM_HPP
|
||||
|
||||
#include <QObject>
|
||||
// Include ui_view.h in source and header
|
||||
#include <ui_view.h>
|
||||
|
||||
class Item : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_SLOT
|
||||
void go();
|
||||
};
|
||||
|
||||
#endif
|
||||
16
Tests/QtAutogen/Parallel/main.cpp
Normal file
16
Tests/QtAutogen/Parallel/main.cpp
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "aaa/bbb/item.hpp"
|
||||
#include "aaa/item.hpp"
|
||||
#include "bbb/aaa/item.hpp"
|
||||
#include "bbb/item.hpp"
|
||||
#include "ccc/item.hpp"
|
||||
|
||||
int main(int argv, char** args)
|
||||
{
|
||||
// Object instances
|
||||
::aaa::Item aaa_item;
|
||||
::aaa::bbb::Item aaa_bbb_item;
|
||||
::bbb::Item bbb_item;
|
||||
::bbb::aaa::Item bbb_aaa_item;
|
||||
::ccc::Item ccc_item;
|
||||
return 0;
|
||||
}
|
||||
24
Tests/QtAutogen/Parallel/parallel.cmake
Normal file
24
Tests/QtAutogen/Parallel/parallel.cmake
Normal file
@@ -0,0 +1,24 @@
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
set(CMAKE_AUTOUIC ON)
|
||||
set(CMAKE_AUTORCC ON)
|
||||
|
||||
|
||||
set(PBASE ${CMAKE_CURRENT_LIST_DIR})
|
||||
set(PARALLEL_SRC
|
||||
${PBASE}/aaa/bbb/item.cpp
|
||||
${PBASE}/aaa/bbb/data.qrc
|
||||
${PBASE}/aaa/item.cpp
|
||||
${PBASE}/aaa/data.qrc
|
||||
|
||||
${PBASE}/bbb/aaa/item.cpp
|
||||
${PBASE}/bbb/aaa/data.qrc
|
||||
${PBASE}/bbb/item.cpp
|
||||
${PBASE}/bbb/data.qrc
|
||||
|
||||
${PBASE}/ccc/item.cpp
|
||||
${PBASE}/ccc/data.qrc
|
||||
|
||||
${PBASE}/item.cpp
|
||||
${PBASE}/data.qrc
|
||||
${PBASE}/main.cpp
|
||||
)
|
||||
24
Tests/QtAutogen/Parallel/view.ui
Normal file
24
Tests/QtAutogen/Parallel/view.ui
Normal file
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>View</class>
|
||||
<widget class="QWidget" name="Base">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QTreeView" name="treeView"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
10
Tests/QtAutogen/Parallel1/CMakeLists.txt
Normal file
10
Tests/QtAutogen/Parallel1/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Parallel1)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallel1 ${PARALLEL_SRC})
|
||||
set_target_properties(parallel1 PROPERTIES AUTOGEN_PARALLEL 1)
|
||||
target_link_libraries(parallel1 ${QT_LIBRARIES})
|
||||
10
Tests/QtAutogen/Parallel2/CMakeLists.txt
Normal file
10
Tests/QtAutogen/Parallel2/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Parallel2)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallel2 ${PARALLEL_SRC})
|
||||
set_target_properties(parallel2 PROPERTIES AUTOGEN_PARALLEL 2)
|
||||
target_link_libraries(parallel2 ${QT_LIBRARIES})
|
||||
10
Tests/QtAutogen/Parallel3/CMakeLists.txt
Normal file
10
Tests/QtAutogen/Parallel3/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Parallel3)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallel3 ${PARALLEL_SRC})
|
||||
set_target_properties(parallel3 PROPERTIES AUTOGEN_PARALLEL 3)
|
||||
target_link_libraries(parallel3 ${QT_LIBRARIES})
|
||||
10
Tests/QtAutogen/Parallel4/CMakeLists.txt
Normal file
10
Tests/QtAutogen/Parallel4/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(Parallel4)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallel4 ${PARALLEL_SRC})
|
||||
set_target_properties(parallel4 PROPERTIES AUTOGEN_PARALLEL 4)
|
||||
target_link_libraries(parallel4 ${QT_LIBRARIES})
|
||||
10
Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
Normal file
10
Tests/QtAutogen/ParallelAUTO/CMakeLists.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(ParallelAUTO)
|
||||
include("../AutogenTest.cmake")
|
||||
|
||||
# Test different values for AUTOGEN_PARALLEL
|
||||
include("../Parallel/parallel.cmake")
|
||||
|
||||
add_executable(parallelAUTO ${PARALLEL_SRC})
|
||||
set_target_properties(parallelAUTO PROPERTIES AUTOGEN_PARALLEL "AUTO")
|
||||
target_link_libraries(parallelAUTO ${QT_LIBRARIES})
|
||||
Reference in New Issue
Block a user