Changeset View
Changeset View
Standalone View
Standalone View
templates/tests/testloadertags.cpp
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 66 | { | |||
---|---|---|---|---|---|
72 | m_engine->addTemplateLoader(loader); | 72 | m_engine->addTemplateLoader(loader); | ||
73 | 73 | | |||
74 | auto appDirPath | 74 | auto appDirPath | ||
75 | = QFileInfo(QCoreApplication::applicationDirPath()).absoluteDir().path(); | 75 | = QFileInfo(QCoreApplication::applicationDirPath()).absoluteDir().path(); | ||
76 | m_engine->setPluginPaths(QStringList() | 76 | m_engine->setPluginPaths(QStringList() | ||
77 | << QStringLiteral(GRANTLEE_PLUGIN_PATH) | 77 | << QStringLiteral(GRANTLEE_PLUGIN_PATH) | ||
78 | << QStringLiteral(":/plugins/") // For testtags.qs | 78 | << QStringLiteral(":/plugins/") // For testtags.qs | ||
79 | ); | 79 | ); | ||
80 | #ifdef HAVE_QTSCRIPT_LIB | 80 | #ifdef HAVE_QTQML_LIB | ||
81 | m_engine->addDefaultLibrary(QStringLiteral("grantlee_scriptabletags")); | 81 | m_engine->addDefaultLibrary(QStringLiteral("grantlee_scriptabletags")); | ||
82 | #endif | 82 | #endif | ||
83 | } | 83 | } | ||
84 | 84 | | |||
85 | void TestLoaderTags::cleanupTestCase() { delete m_engine; } | 85 | void TestLoaderTags::cleanupTestCase() { delete m_engine; } | ||
86 | 86 | | |||
87 | void TestLoaderTags::doTest() | 87 | void TestLoaderTags::doTest() | ||
88 | { | 88 | { | ||
▲ Show 20 Lines • Show All 206 Lines • ▼ Show 20 Line(s) | 294 | QTest::newRow("inheritance15") << inh15 << dict << QStringLiteral("12inner3_") | |||
295 | << NoError; | 295 | << NoError; | ||
296 | // A block within another block (level 2) | 296 | // A block within another block (level 2) | ||
297 | 297 | | |||
298 | QTest::newRow("inheritance16") | 298 | QTest::newRow("inheritance16") | ||
299 | << QStringLiteral( | 299 | << QStringLiteral( | ||
300 | "{% extends 'inheritance15' %}{% block inner %}out{% endblock %}") | 300 | "{% extends 'inheritance15' %}{% block inner %}out{% endblock %}") | ||
301 | << dict << QStringLiteral("12out3_") << NoError; | 301 | << dict << QStringLiteral("12out3_") << NoError; | ||
302 | 302 | | |||
303 | #ifdef HAVE_QTSCRIPT_LIB | 303 | #ifdef HAVE_QTQML_LIB | ||
304 | // {% load %} tag (parent -- setup for exception04) | 304 | // {% load %} tag (parent -- setup for exception04) | ||
305 | auto inh17 = QStringLiteral( | 305 | auto inh17 = QStringLiteral( | ||
306 | "{% load testtags %}{% block first %}1234{% endblock %}"); | 306 | "{% load testtags %}{% block first %}1234{% endblock %}"); | ||
307 | loader->setTemplate(QStringLiteral("inheritance17"), inh17); | 307 | loader->setTemplate(QStringLiteral("inheritance17"), inh17); | ||
308 | 308 | | |||
309 | dict.clear(); | 309 | dict.clear(); | ||
310 | QTest::newRow("inheritance17") << inh17 << dict << QStringLiteral("1234") | 310 | QTest::newRow("inheritance17") << inh17 << dict << QStringLiteral("1234") | ||
311 | << NoError; | 311 | << NoError; | ||
▲ Show 20 Lines • Show All 201 Lines • Show Last 20 Lines |