Commit 8dbdd3e7 authored by Sebastian Holtermann's avatar Sebastian Holtermann

AUTOGEN: Tests: AUTOMOC SKIP_AUTOMOC and SKIP_AUTOGEN test

parent 0699760d
Pipeline #41664 passed with stage
......@@ -139,6 +139,28 @@ if (automoc_rerun_result)
message(SEND_ERROR "Second build of automoc_rerun failed.")
endif()
# -- Test: AUTOMOC, SKIP_AUTOMOC
# Test for SKIP_AUTOMOC and SKIP_AUTOGEN on an AUTOMOC enabled target
qtx_wrap_cpp(skipMocWrapMoc
skipSource/qItemA.hpp
skipSource/qItemB.hpp)
set(skipMocSources
skipMoc.cpp
skipSource/qItemA.cpp
skipSource/qItemB.cpp
skipSource/qItemC.cpp)
set_property(SOURCE skipSource/qItemA.cpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE skipSource/qItemB.cpp PROPERTY SKIP_AUTOGEN ON)
# AUTOMOC enabled only
add_executable(skipMocA ${skipMocSources} ${skipMocWrapMoc})
set_property(TARGET skipMocA PROPERTY AUTOMOC ON)
target_link_libraries(skipMocA ${QT_LIBRARIES})
# AUTOMOC and AUTOUIC enabled
add_executable(skipMocB ${skipMocSources} ${skipMocWrapMoc})
set_property(TARGET skipMocB PROPERTY AUTOMOC ON)
set_property(TARGET skipMocB PROPERTY AUTOUIC ON)
target_link_libraries(skipMocB ${QT_LIBRARIES})
# -- Test: AUTOMOC AUTORCC
# Source files with the same basename in different subdirectories
add_subdirectory(sameName)
......
#include "skipSource/qItemA.hpp"
#include "skipSource/qItemB.hpp"
#include "skipSource/qItemC.hpp"
int main(int, char**)
{
QItemA itemA;
QItemA itemB;
QItemA itemC;
// Fails to link if the symbol is not present.
return 0;
}
#include "qItemA.hpp"
void QItemA::go()
{
}
#ifndef QITEMA_HPP
#define QITEMA_HPP
#include <QObject>
class QItemA : public QObject
{
Q_OBJECT
Q_SLOT
void go();
};
#endif
#include "qItemB.hpp"
void QItemB::go()
{
}
#ifndef QITEMB_HPP
#define QITEMB_HPP
#include <QObject>
class QItemB : public QObject
{
Q_OBJECT
Q_SLOT
void go();
};
#endif
#include "qItemC.hpp"
void QItemC::go()
{
}
#ifndef QITEMC_HPP
#define QITEMC_HPP
#include <QObject>
class QItemC : public QObject
{
Q_OBJECT
Q_SLOT
void go();
};
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment