MCPcopy Create free account
hub / github.com/cutelyst/cutelyst / getEngine

Method getEngine

tests/testactionrenderview.cpp:117–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115}
116
117TestEngine *TestActionRenderView::getEngine()
118{
119 qputenv("RECURSION", QByteArrayLiteral("10"));
120
121 QDir buildDir = QDir::current();
122 std::ignore = buildDir.cd(u".."_s);
123
124 QDir current = buildDir;
125 QString pluginPaths = current.absolutePath();
126
127 std::ignore = current.cd(u"Cutelyst/Actions/RenderView"_s);
128 pluginPaths += u';' + current.absolutePath();
129
130 current = buildDir;
131 std::ignore = current.cd(u"Release"_s);
132 pluginPaths += u';' + current.absolutePath();
133
134 current = buildDir;
135 std::ignore = current.cd(u"Release/Cutelyst/Actions/RenderView"_s);
136 pluginPaths += u';' + current.absolutePath();
137
138 current = buildDir;
139 std::ignore = current.cd(u"Debug"_s);
140 pluginPaths += u';' + current.absolutePath();
141
142 current = buildDir;
143 std::ignore = current.cd(u"Debug/Cutelyst/Actions/RenderView"_s);
144 pluginPaths += u';' + current.absolutePath();
145
146 qDebug() << "setting CUTELYST_PLUGINS_DIR to" << pluginPaths;
147 qputenv("CUTELYST_PLUGINS_DIR", pluginPaths.toLocal8Bit());
148
149 auto app = new TestApplication;
150 auto engine = new TestEngine(app, QVariantMap());
151 new ActionRenderView(app);
152 new TestView(app);
153 new TestView(app, u"view1"_s);
154 new TestView(app, u"view2"_s);
155
156 if (!engine->init()) {
157 return nullptr;
158 }
159 return engine;
160}
161
162void TestActionRenderView::cleanupTestCase()
163{

Callers

nothing calls this directly

Calls 1

initMethod · 0.45

Tested by

no test coverage detected