dtkWidgetsTest.h 1003 Bytes
Newer Older
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 26
#pragma once

#include <QtTest>

#define DTKWIDGETSTEST_MAIN(TestMain, TestObject)   \
    int TestMain(int argc, char *argv[])            \
    {                                               \
        QApplication app(argc, argv);               \
        TestObject tc;                              \
        return QTest::qExec(&tc, argc, argv);       \
    }

#define DTKWIDGETSTEST_MAIN_GUI(TestMain, TestObject) \
    int TestMain(int argc, char *argv[])              \
    {                                                 \
        QGuiApplication app(argc, argv);              \
        TestObject tc;                                \
        return QTest::qExec(&tc, argc, argv);         \
    }

#define DTKWIDGETSTEST_MAIN_NOGUI(TestMain, TestObject)	\
    int TestMain(int argc, char *argv[]) {              \
        QCoreApplication app(argc, argv);               \
        TestObject tc;                                  \
        return QTest::qExec(&tc, argc, argv);           \
    }