~tpeeters/ubuntu-ui-toolkit/ensureVisible

« back to all changes in this revision

Viewing changes to tests/unit_x11/tst_theme_engine/tst_theme_enginetest.cpp

  • Committer: Zoltán Balogh
  • Date: 2014-11-20 12:23:57 UTC
  • mfrom: (1337.1.5 uut.staging)
  • Revision ID: zoltan@bakter.hu-20141120122357-gby8b2zez6c3tnvk
Always append QML2 import path regardless of QML2_IMPORT_PATH

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
    void testThemesRelativePathWithParentXDGDATA();
44
44
    void testThemesRelativePathWithParentNoVariablesSet();
45
45
    void testThemesRelativePathWithParentOneXDGPathSet();
 
46
    void testNoImportPathSet();
 
47
    void testBogusImportPathSet();
 
48
    void testMultipleImportPathsSet();
46
49
};
47
50
 
48
51
void tst_UCTheme::initTestCase()
192
195
    QCOMPARE(component != NULL, true);
193
196
    QCOMPARE(component->status(), QQmlComponent::Ready);}
194
197
 
 
198
void tst_UCTheme::testNoImportPathSet()
 
199
{
 
200
    if (!QFile(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) + "/Ubuntu/Components").exists())
 
201
        QSKIP("This can only be tested if the UITK is installed");
 
202
 
 
203
    qputenv("UBUNTU_UI_TOOLKIT_THEMES_PATH", "");
 
204
    qputenv("XDG_DATA_DIRS", "");
 
205
    qputenv("QML2_IMPORT_PATH", "");
 
206
 
 
207
    UCTheme theme;
 
208
    QCOMPARE(theme.name(), QString("Ubuntu.Components.Themes.Ambiance"));
 
209
}
 
210
 
 
211
void tst_UCTheme::testBogusImportPathSet()
 
212
{
 
213
    if (!QFile(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) + "/Ubuntu/Components").exists())
 
214
        QSKIP("This can only be tested if the UITK is installed");
 
215
 
 
216
    qputenv("UBUNTU_UI_TOOLKIT_THEMES_PATH", "");
 
217
    qputenv("XDG_DATA_DIRS", "");
 
218
    qputenv("QML2_IMPORT_PATH", "/no/plugins/here");
 
219
 
 
220
    UCTheme theme;
 
221
    QCOMPARE(theme.name(), QString("Ubuntu.Components.Themes.Ambiance"));
 
222
}
 
223
 
 
224
void tst_UCTheme::testMultipleImportPathsSet()
 
225
{
 
226
    if (!QFile(QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath) + "/Ubuntu/Components").exists())
 
227
        QSKIP("This can only be tested if the UITK is installed");
 
228
 
 
229
    qputenv("UBUNTU_UI_TOOLKIT_THEMES_PATH", "");
 
230
    qputenv("XDG_DATA_DIRS", "");
 
231
    qputenv("QML2_IMPORT_PATH", "/no/plugins/here:.");
 
232
 
 
233
    UCTheme theme;
 
234
    theme.setName("TestModule.TestTheme");
 
235
}
 
236
 
195
237
QTEST_MAIN(tst_UCTheme)
196
238
 
197
239
#include "tst_theme_enginetest.moc"