summaryrefslogtreecommitdiff
path: root/tests/tst_qml/tst_qmltest.cpp
blob: 8d64af8d5a3ec6da41681a6548405994bcbd4d9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#define QUICK_TEST_SOURCE_DIR Context().testSourceDir()

#include <QtQuickTest/QtQuickTest>

class Context
{
public:
    Context()
    {
        const char importPathVarName[] = "QML2_IMPORT_PATH";
        QByteArray importPath = qgetenv(importPathVarName);

        if (not importPath.isEmpty())
            importPath = ':' + importPath;

        qputenv(importPathVarName, TOP_OUTDIR "/src" + importPath);
    }

    const char *testSourceDir() const
    {
        return SRCDIR;
    }
};

QUICK_TEST_MAIN()