diff options
author | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-07-27 13:16:15 (GMT) |
---|---|---|
committer | Trond Kjernåsen <trond.kjernasen@nokia.com> | 2010-07-27 13:34:50 (GMT) |
commit | a62045401cc8f55c3175a2b33e8f43b356604f37 (patch) | |
tree | 58bd1583879334bf058cd524015159f57de1c9e6 | |
parent | b932141c7d59eaee5ae72c914d7fc7078b0a3608 (diff) | |
download | Qt-a62045401cc8f55c3175a2b33e8f43b356604f37.zip Qt-a62045401cc8f55c3175a2b33e8f43b356604f37.tar.gz Qt-a62045401cc8f55c3175a2b33e8f43b356604f37.tar.bz2 |
Don't run the QGL test on systems that does not have GL support.
On a Mac that has no screens connected, it is possible to create
offscreen GL contexts, but not normal QGLWidgets. There are some
assumptions both in the tests and in the QGL module that this if you
can create one of them, you can create both.
The test now check if it can create a valid QGLWidget, if it can't
it will skip running all the QGL tests.
Task-number: QTBUG-12138
Reviewed-by: Prasanth
-rw-r--r-- | tests/auto/qgl/tst_qgl.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tests/auto/qgl/tst_qgl.cpp b/tests/auto/qgl/tst_qgl.cpp index 8ee494f..7fe461c 100644 --- a/tests/auto/qgl/tst_qgl.cpp +++ b/tests/auto/qgl/tst_qgl.cpp @@ -2252,5 +2252,30 @@ void tst_QGL::textureCleanup() #endif } -QTEST_MAIN(tst_QGL) +class tst_QGLDummy : public QObject +{ +Q_OBJECT + +public: + tst_QGLDummy() {} + +private slots: + void qglSkipTests() { + QSKIP("QGL not supported on this system.", SkipAll); + } +}; + +int main(int argc, char **argv) +{ + QApplication app(argc, argv); + QTEST_DISABLE_KEYPAD_NAVIGATION \ + QGLWidget glWidget; + if (!glWidget.isValid()) { + tst_QGLDummy tc; + return QTest::qExec(&tc, argc, argv); + } + tst_QGL tc; + return QTest::qExec(&tc, argc, argv); +} + #include "tst_qgl.moc" |