diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-11-10 11:43:13 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2016-11-23 15:48:06 +0000 |
commit | 885e418daa1f882474008cf0e9f14e20392c409e (patch) | |
tree | cf53bd72a64ed01d8728c1fd8dc7a3c1dbf99a41 | |
parent | b6e32a782ad189260601e98ef8f46d6ecc463750 (diff) |
ApiExtractor-tests: Have moc parse the test headers
Add the headers to the project depending on existence, removing the
need to include the .moc file. This makes it possible have a
standard-qmake build.
Change-Id: Ia702281b68e35c8e9d5ac624e8584d708dbbdbbb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
36 files changed, 5 insertions, 65 deletions
diff --git a/ApiExtractor/tests/CMakeLists.txt b/ApiExtractor/tests/CMakeLists.txt index 041a17a55..e207609d5 100644 --- a/ApiExtractor/tests/CMakeLists.txt +++ b/ApiExtractor/tests/CMakeLists.txt @@ -6,7 +6,11 @@ find_package(Qt5XmlPatterns) macro(declare_test testname) # gone: qt4_automoc("${testname}.cpp") - add_executable(${testname} "${testname}.cpp") + if (EXISTS "${testname}.h") + add_executable(${testname} "${testname}.h ${testname}.cpp") + else () + add_executable(${testname} "${testname}.cpp") + endif () include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${apiextractor_SOURCE_DIR} diff --git a/ApiExtractor/tests/testabstractmetaclass.cpp b/ApiExtractor/tests/testabstractmetaclass.cpp index 87d99b2dc..7899c751b 100644 --- a/ApiExtractor/tests/testabstractmetaclass.cpp +++ b/ApiExtractor/tests/testabstractmetaclass.cpp @@ -447,5 +447,3 @@ void TestAbstractMetaClass::testIsPolymorphic() } QTEST_APPLESS_MAIN(TestAbstractMetaClass) - -#include "testabstractmetaclass.moc" diff --git a/ApiExtractor/tests/testabstractmetatype.cpp b/ApiExtractor/tests/testabstractmetatype.cpp index 033e424b5..918a3bded 100644 --- a/ApiExtractor/tests/testabstractmetatype.cpp +++ b/ApiExtractor/tests/testabstractmetatype.cpp @@ -207,5 +207,3 @@ void TestAbstractMetaType::testObjectTypeUsedAsValue() } QTEST_APPLESS_MAIN(TestAbstractMetaType) - -#include "testabstractmetatype.moc" diff --git a/ApiExtractor/tests/testaddfunction.cpp b/ApiExtractor/tests/testaddfunction.cpp index 65e9a01b9..b6889621a 100644 --- a/ApiExtractor/tests/testaddfunction.cpp +++ b/ApiExtractor/tests/testaddfunction.cpp @@ -433,5 +433,3 @@ void TestAddFunction::testAddFunctionWithTemplateArg() QTEST_APPLESS_MAIN(TestAddFunction) -#include "testaddfunction.moc" - diff --git a/ApiExtractor/tests/testarrayargument.cpp b/ApiExtractor/tests/testarrayargument.cpp index 57294f98c..bc45f8e81 100644 --- a/ApiExtractor/tests/testarrayargument.cpp +++ b/ApiExtractor/tests/testarrayargument.cpp @@ -122,5 +122,3 @@ void TestArrayArgument::testArrayArgumentWithSizeDefinedByEnumValueFromGlobalEnu }; QTEST_APPLESS_MAIN(TestArrayArgument) - -#include "testarrayargument.moc" diff --git a/ApiExtractor/tests/testcodeinjection.cpp b/ApiExtractor/tests/testcodeinjection.cpp index 5064b99f2..e5902e3ef 100644 --- a/ApiExtractor/tests/testcodeinjection.cpp +++ b/ApiExtractor/tests/testcodeinjection.cpp @@ -99,5 +99,3 @@ void TestCodeInjections::testInjectWithInvalidApiVersion() QTEST_APPLESS_MAIN(TestCodeInjections) - -#include "testcodeinjection.moc" diff --git a/ApiExtractor/tests/testcontainer.cpp b/ApiExtractor/tests/testcontainer.cpp index 572f55a63..823e38693 100644 --- a/ApiExtractor/tests/testcontainer.cpp +++ b/ApiExtractor/tests/testcontainer.cpp @@ -101,4 +101,3 @@ void TestContainer::testListOfValueType() QTEST_APPLESS_MAIN(TestContainer) -#include "testcontainer.moc" diff --git a/ApiExtractor/tests/testconversionoperator.cpp b/ApiExtractor/tests/testconversionoperator.cpp index 2ac88e502..49b31bf11 100644 --- a/ApiExtractor/tests/testconversionoperator.cpp +++ b/ApiExtractor/tests/testconversionoperator.cpp @@ -180,5 +180,3 @@ void TestConversionOperator::testConversionOperatorReturningConstReference() } QTEST_APPLESS_MAIN(TestConversionOperator) - -#include "testconversionoperator.moc" diff --git a/ApiExtractor/tests/testconversionruletag.cpp b/ApiExtractor/tests/testconversionruletag.cpp index 16dd0cd5a..33a85d998 100644 --- a/ApiExtractor/tests/testconversionruletag.cpp +++ b/ApiExtractor/tests/testconversionruletag.cpp @@ -231,5 +231,3 @@ void TestConversionRuleTag::testConversionRuleTagWithInsertTemplate() } QTEST_APPLESS_MAIN(TestConversionRuleTag) - -#include "testconversionruletag.moc" diff --git a/ApiExtractor/tests/testctorinformation.cpp b/ApiExtractor/tests/testctorinformation.cpp index 0c115cf0b..ed3d367d1 100644 --- a/ApiExtractor/tests/testctorinformation.cpp +++ b/ApiExtractor/tests/testctorinformation.cpp @@ -71,6 +71,3 @@ void TestCtorInformation::testHasNonPrivateCtor() } QTEST_APPLESS_MAIN(TestCtorInformation) - -#include "testctorinformation.moc" - diff --git a/ApiExtractor/tests/testdroptypeentries.cpp b/ApiExtractor/tests/testdroptypeentries.cpp index 5f326638c..d655f0b75 100644 --- a/ApiExtractor/tests/testdroptypeentries.cpp +++ b/ApiExtractor/tests/testdroptypeentries.cpp @@ -138,6 +138,3 @@ void TestDropTypeEntries::testDontDropEntryWithChildTags() } QTEST_APPLESS_MAIN(TestDropTypeEntries) - -#include "testdroptypeentries.moc" - diff --git a/ApiExtractor/tests/testdtorinformation.cpp b/ApiExtractor/tests/testdtorinformation.cpp index a140b9806..98d918f3b 100644 --- a/ApiExtractor/tests/testdtorinformation.cpp +++ b/ApiExtractor/tests/testdtorinformation.cpp @@ -77,5 +77,4 @@ void TestDtorInformation::testClassWithVirtualDtorIsPolymorphic() QTEST_APPLESS_MAIN(TestDtorInformation) -#include "testdtorinformation.moc" diff --git a/ApiExtractor/tests/testenum.cpp b/ApiExtractor/tests/testenum.cpp index 8cd099d0b..0e88f968d 100644 --- a/ApiExtractor/tests/testenum.cpp +++ b/ApiExtractor/tests/testenum.cpp @@ -412,5 +412,3 @@ void TestEnum::testTypedefEnum() } QTEST_APPLESS_MAIN(TestEnum) - -#include "testenum.moc" diff --git a/ApiExtractor/tests/testextrainclude.cpp b/ApiExtractor/tests/testextrainclude.cpp index 6b59cb4fd..c42331e91 100644 --- a/ApiExtractor/tests/testextrainclude.cpp +++ b/ApiExtractor/tests/testextrainclude.cpp @@ -79,6 +79,3 @@ void TestExtraInclude::testGlobalExtraIncludes() } QTEST_APPLESS_MAIN(TestExtraInclude) - -#include "testextrainclude.moc" - diff --git a/ApiExtractor/tests/testfunctiontag.cpp b/ApiExtractor/tests/testfunctiontag.cpp index 46ad8b298..1687bdd65 100644 --- a/ApiExtractor/tests/testfunctiontag.cpp +++ b/ApiExtractor/tests/testfunctiontag.cpp @@ -90,5 +90,3 @@ void TestFunctionTag::testRenameGlobalFunction() QTEST_APPLESS_MAIN(TestFunctionTag) -#include "testfunctiontag.moc" - diff --git a/ApiExtractor/tests/testimplicitconversions.cpp b/ApiExtractor/tests/testimplicitconversions.cpp index d0752c72c..c437e2e83 100644 --- a/ApiExtractor/tests/testimplicitconversions.cpp +++ b/ApiExtractor/tests/testimplicitconversions.cpp @@ -159,5 +159,3 @@ void TestImplicitConversions::testWithExternalConversionOperator() } QTEST_APPLESS_MAIN(TestImplicitConversions) - -#include "testimplicitconversions.moc" diff --git a/ApiExtractor/tests/testinserttemplate.cpp b/ApiExtractor/tests/testinserttemplate.cpp index b17fb1225..612de9b73 100644 --- a/ApiExtractor/tests/testinserttemplate.cpp +++ b/ApiExtractor/tests/testinserttemplate.cpp @@ -122,5 +122,3 @@ void TestInsertTemplate::testValidAndInvalidTypeSystemTemplate() } QTEST_APPLESS_MAIN(TestInsertTemplate) - -#include "testinserttemplate.moc" diff --git a/ApiExtractor/tests/testmodifydocumentation.cpp b/ApiExtractor/tests/testmodifydocumentation.cpp index 507992a0c..ac3189ad3 100644 --- a/ApiExtractor/tests/testmodifydocumentation.cpp +++ b/ApiExtractor/tests/testmodifydocumentation.cpp @@ -76,5 +76,3 @@ int main(int argc, char** argv) TestModifyDocumentation tc; return QTest::qExec(&tc, argc, argv); } - -#include "testmodifydocumentation.moc" diff --git a/ApiExtractor/tests/testmodifyfunction.cpp b/ApiExtractor/tests/testmodifyfunction.cpp index d739c1a9b..b81237320 100644 --- a/ApiExtractor/tests/testmodifyfunction.cpp +++ b/ApiExtractor/tests/testmodifyfunction.cpp @@ -245,5 +245,3 @@ void TestModifyFunction::testGlobalFunctionModification() } QTEST_APPLESS_MAIN(TestModifyFunction) - -#include "testmodifyfunction.moc" diff --git a/ApiExtractor/tests/testmultipleinheritance.cpp b/ApiExtractor/tests/testmultipleinheritance.cpp index f9dab8d06..1e483a7a8 100644 --- a/ApiExtractor/tests/testmultipleinheritance.cpp +++ b/ApiExtractor/tests/testmultipleinheritance.cpp @@ -70,5 +70,3 @@ void TestMultipleInheritance::testVirtualClass() } QTEST_APPLESS_MAIN(TestMultipleInheritance) - -#include "testmultipleinheritance.moc" diff --git a/ApiExtractor/tests/testnamespace.cpp b/ApiExtractor/tests/testnamespace.cpp index e6e4ab287..028beb98c 100644 --- a/ApiExtractor/tests/testnamespace.cpp +++ b/ApiExtractor/tests/testnamespace.cpp @@ -90,5 +90,3 @@ void TestNamespace::testNamespaceInnerClassMembers() QTEST_APPLESS_MAIN(TestNamespace) -#include "testnamespace.moc" - diff --git a/ApiExtractor/tests/testnestedtypes.cpp b/ApiExtractor/tests/testnestedtypes.cpp index 7e64a2424..624f5b4c9 100644 --- a/ApiExtractor/tests/testnestedtypes.cpp +++ b/ApiExtractor/tests/testnestedtypes.cpp @@ -123,5 +123,3 @@ void TestNestedTypes::testDuplicationOfNestedTypes() } QTEST_APPLESS_MAIN(TestNestedTypes) - -#include "testnestedtypes.moc" diff --git a/ApiExtractor/tests/testnumericaltypedef.cpp b/ApiExtractor/tests/testnumericaltypedef.cpp index c193d161e..dde957b00 100644 --- a/ApiExtractor/tests/testnumericaltypedef.cpp +++ b/ApiExtractor/tests/testnumericaltypedef.cpp @@ -115,4 +115,3 @@ void TestNumericalTypedef::testUnsignedNumericalTypedef() QTEST_APPLESS_MAIN(TestNumericalTypedef) -#include "testnumericaltypedef.moc" diff --git a/ApiExtractor/tests/testprimitivetypetag.cpp b/ApiExtractor/tests/testprimitivetypetag.cpp index 281b30979..39db551bb 100644 --- a/ApiExtractor/tests/testprimitivetypetag.cpp +++ b/ApiExtractor/tests/testprimitivetypetag.cpp @@ -56,5 +56,3 @@ void TestPrimitiveTypeTag::testPrimitiveTypeDefaultConstructor() QTEST_APPLESS_MAIN(TestPrimitiveTypeTag) -#include "testprimitivetypetag.moc" - diff --git a/ApiExtractor/tests/testrefcounttag.cpp b/ApiExtractor/tests/testrefcounttag.cpp index 3c5857904..1e5d86fef 100644 --- a/ApiExtractor/tests/testrefcounttag.cpp +++ b/ApiExtractor/tests/testrefcounttag.cpp @@ -95,5 +95,4 @@ void TestRefCountTag::testWithApiVersion() QTEST_APPLESS_MAIN(TestRefCountTag) -#include "testrefcounttag.moc" diff --git a/ApiExtractor/tests/testreferencetopointer.cpp b/ApiExtractor/tests/testreferencetopointer.cpp index 45be27b64..a80521a00 100644 --- a/ApiExtractor/tests/testreferencetopointer.cpp +++ b/ApiExtractor/tests/testreferencetopointer.cpp @@ -54,5 +54,4 @@ void TestReferenceToPointer::testReferenceToPointerArgument() QTEST_APPLESS_MAIN(TestReferenceToPointer) -#include "testreferencetopointer.moc" diff --git a/ApiExtractor/tests/testremovefield.cpp b/ApiExtractor/tests/testremovefield.cpp index c2ab290b8..64a128c7b 100644 --- a/ApiExtractor/tests/testremovefield.cpp +++ b/ApiExtractor/tests/testremovefield.cpp @@ -57,5 +57,4 @@ void TestRemoveField::testRemoveField() QTEST_APPLESS_MAIN(TestRemoveField) -#include "testremovefield.moc" diff --git a/ApiExtractor/tests/testremoveimplconv.cpp b/ApiExtractor/tests/testremoveimplconv.cpp index 9cb1c45b1..31bc5607f 100644 --- a/ApiExtractor/tests/testremoveimplconv.cpp +++ b/ApiExtractor/tests/testremoveimplconv.cpp @@ -65,5 +65,3 @@ void TestRemoveImplConv::testRemoveImplConv() } QTEST_APPLESS_MAIN(TestRemoveImplConv) - -#include "testremoveimplconv.moc" diff --git a/ApiExtractor/tests/testremoveoperatormethod.cpp b/ApiExtractor/tests/testremoveoperatormethod.cpp index f985f21dd..de173586b 100644 --- a/ApiExtractor/tests/testremoveoperatormethod.cpp +++ b/ApiExtractor/tests/testremoveoperatormethod.cpp @@ -117,4 +117,3 @@ void TestRemoveOperatorMethod::testRemoveOperatorMethod() QTEST_APPLESS_MAIN(TestRemoveOperatorMethod) -#include "testremoveoperatormethod.moc" diff --git a/ApiExtractor/tests/testresolvetype.cpp b/ApiExtractor/tests/testresolvetype.cpp index 8260f0291..032765118 100644 --- a/ApiExtractor/tests/testresolvetype.cpp +++ b/ApiExtractor/tests/testresolvetype.cpp @@ -59,5 +59,3 @@ void TestResolveType::testResolveReturnTypeFromParentScope() QTEST_APPLESS_MAIN(TestResolveType) -#include "testresolvetype.moc" - diff --git a/ApiExtractor/tests/testreverseoperators.cpp b/ApiExtractor/tests/testreverseoperators.cpp index 28e9d294a..8ad9d4cee 100644 --- a/ApiExtractor/tests/testreverseoperators.cpp +++ b/ApiExtractor/tests/testreverseoperators.cpp @@ -132,4 +132,3 @@ void TestReverseOperators::testReverseSumWithAmbiguity() QTEST_APPLESS_MAIN(TestReverseOperators) -#include "testreverseoperators.moc" diff --git a/ApiExtractor/tests/testtemplates.cpp b/ApiExtractor/tests/testtemplates.cpp index 521715e4d..dd23c7ef7 100644 --- a/ApiExtractor/tests/testtemplates.cpp +++ b/ApiExtractor/tests/testtemplates.cpp @@ -384,5 +384,3 @@ void TestTemplates::testContainerTypeIncompleteArgument() } QTEST_APPLESS_MAIN(TestTemplates) - -#include "testtemplates.moc" diff --git a/ApiExtractor/tests/testtoposort.cpp b/ApiExtractor/tests/testtoposort.cpp index 6c697e877..30d368a8a 100644 --- a/ApiExtractor/tests/testtoposort.cpp +++ b/ApiExtractor/tests/testtoposort.cpp @@ -67,4 +67,3 @@ void TestTopoSort::testCiclicGraph() QTEST_APPLESS_MAIN(TestTopoSort) -#include "testtoposort.moc" diff --git a/ApiExtractor/tests/testtyperevision.cpp b/ApiExtractor/tests/testtyperevision.cpp index 007918117..a0d74e568 100644 --- a/ApiExtractor/tests/testtyperevision.cpp +++ b/ApiExtractor/tests/testtyperevision.cpp @@ -66,5 +66,4 @@ void TestTypeRevision::testRevisionAttr() QTEST_APPLESS_MAIN(TestTypeRevision) -#include "testtyperevision.moc" diff --git a/ApiExtractor/tests/testvaluetypedefaultctortag.cpp b/ApiExtractor/tests/testvaluetypedefaultctortag.cpp index 14e99b980..cc9cb0fa9 100644 --- a/ApiExtractor/tests/testvaluetypedefaultctortag.cpp +++ b/ApiExtractor/tests/testvaluetypedefaultctortag.cpp @@ -58,5 +58,3 @@ void TestValueTypeDefaultCtorTag::testValueTypeDefaultCtorTagArgument() } QTEST_APPLESS_MAIN(TestValueTypeDefaultCtorTag) - -#include "testvaluetypedefaultctortag.moc" diff --git a/ApiExtractor/tests/testvoidarg.cpp b/ApiExtractor/tests/testvoidarg.cpp index 7a0b740c9..6f4122e7f 100644 --- a/ApiExtractor/tests/testvoidarg.cpp +++ b/ApiExtractor/tests/testvoidarg.cpp @@ -81,6 +81,3 @@ void TestVoidArg::testVoidPointerParsedFunction() } QTEST_APPLESS_MAIN(TestVoidArg) - -#include "testvoidarg.moc" - |