diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-12-11 09:44:50 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2018-12-11 20:39:54 +0000 |
commit | 123031b6efa9e95c787b2069fed6f6777a92dc13 (patch) | |
tree | 6aebb4d92f62ef55492a7d0a11355db68dd5abab /sources/shiboken2/ApiExtractor/tests | |
parent | be44e04d6ab219ba70decbe6f7f8e33293c49418 (diff) |
shiboken: Make warning about non-existing templates fatal
It should abort as it will usually result in broken code.
Change-Id: I81d930c4516b0ee97dec985525fab8140fdce3dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/shiboken2/ApiExtractor/tests')
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp | 46 | ||||
-rw-r--r-- | sources/shiboken2/ApiExtractor/tests/testinserttemplate.h | 2 |
2 files changed, 0 insertions, 48 deletions
diff --git a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp index 766265def..8962f83ff 100644 --- a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp +++ b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.cpp @@ -81,50 +81,4 @@ void TestInsertTemplate::testInsertTemplateOnModuleInjectCode() QVERIFY(code.contains(QLatin1String("code template content"))); } -void TestInsertTemplate::testInvalidTypeSystemTemplate() -{ - const char* cppCode =""; - const char* xmlCode = "\ - <typesystem package='Foo'>\n\ - <inject-code class='native'>\n\ - <insert-template name='this_code_template_does_not_exists'/>\n\ - </inject-code>\n\ - </typesystem>\n"; - QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false)); - QVERIFY(!builder.isNull()); - AbstractMetaClassList classes = builder->classes(); - QVERIFY(classes.isEmpty()); - - TypeEntry* module = TypeDatabase::instance()->findType(QLatin1String("Foo")); - QVERIFY(module); - QCOMPARE(module->codeSnips().count(), 1); - QString code = module->codeSnips().first().code().trimmed(); - QVERIFY(code.isEmpty()); -} - -void TestInsertTemplate::testValidAndInvalidTypeSystemTemplate() -{ - const char* cppCode =""; - const char* xmlCode = "\ - <typesystem package='Foo'>\n\ - <template name='code_template'>\n\ - code template content\n\ - </template>\n\ - <inject-code class='native'>\n\ - <insert-template name='this_code_template_does_not_exists'/>\n\ - <insert-template name='code_template'/>\n\ - </inject-code>\n\ - </typesystem>\n"; - QScopedPointer<AbstractMetaBuilder> builder(TestUtil::parse(cppCode, xmlCode, false)); - QVERIFY(!builder.isNull()); - AbstractMetaClassList classes = builder->classes(); - QVERIFY(classes.isEmpty()); - - TypeEntry* module = TypeDatabase::instance()->findType(QLatin1String("Foo")); - QVERIFY(module); - QCOMPARE(module->codeSnips().count(), 1); - QString code = module->codeSnips().first().code().trimmed(); - QVERIFY(code.contains(QLatin1String("code template content"))); -} - QTEST_APPLESS_MAIN(TestInsertTemplate) diff --git a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.h b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.h index 45a85493c..99b171933 100644 --- a/sources/shiboken2/ApiExtractor/tests/testinserttemplate.h +++ b/sources/shiboken2/ApiExtractor/tests/testinserttemplate.h @@ -37,8 +37,6 @@ class TestInsertTemplate : public QObject private slots: void testInsertTemplateOnClassInjectCode(); void testInsertTemplateOnModuleInjectCode(); - void testInvalidTypeSystemTemplate(); - void testValidAndInvalidTypeSystemTemplate(); }; #endif |