diff options
author | aavit <qt-info@nokia.com> | 2010-11-22 13:48:10 (GMT) |
---|---|---|
committer | aavit <qt-info@nokia.com> | 2010-11-22 13:48:10 (GMT) |
commit | 779dd15d1297c99970fc63a290fca22a405c267f (patch) | |
tree | c8edc5a9790c729d6f855dce0120c17b57989b36 /tests/auto/lancelot | |
parent | 0b63c90f5f4f5d1948e63c12f8b9b3395d316809 (diff) | |
download | Qt-779dd15d1297c99970fc63a290fca22a405c267f.zip Qt-779dd15d1297c99970fc63a290fca22a405c267f.tar.gz Qt-779dd15d1297c99970fc63a290fca22a405c267f.tar.bz2 |
Add cmd to simulate testfail. Misc server improvements.
Diffstat (limited to 'tests/auto/lancelot')
-rw-r--r-- | tests/auto/lancelot/tst_lancelot.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/lancelot/tst_lancelot.cpp b/tests/auto/lancelot/tst_lancelot.cpp index 8467672..0c5d787 100644 --- a/tests/auto/lancelot/tst_lancelot.cpp +++ b/tests/auto/lancelot/tst_lancelot.cpp @@ -63,6 +63,8 @@ Q_OBJECT public: tst_Lancelot(); + static bool simfail; + private: ImageItem render(const ImageItem &item); void paint(QPaintDevice *device, const QStringList &script, const QString &filePath); @@ -91,6 +93,8 @@ private slots: #endif }; +bool tst_Lancelot::simfail = false; + tst_Lancelot::tst_Lancelot() { } @@ -290,12 +294,36 @@ void tst_Lancelot::paint(QPaintDevice *device, const QStringList &script, const { QPainter p(device); PaintCommands pcmd(script, 800, 800); + //pcmd.setShouldDrawText(false); pcmd.setType(ImageType); pcmd.setPainter(&p); pcmd.setFilePath(filePath); pcmd.runCommands(); + + if (simfail) { + p.drawLine(0, 0, 800, 800); + simfail = false; + } + p.end(); } +#define main rmain QTEST_MAIN(tst_Lancelot) +#undef main + +int main(int argc, char *argv[]) +{ + char *fargv[20]; + int fargc = 0; + for (int i = 0; i < qMin(argc, 19); i++) { + if (!qstrcmp(argv[i], "-simfail")) + tst_Lancelot::simfail = true; + else + fargv[fargc++] = argv[i]; + } + fargv[fargc] = 0; + return rmain(fargc, fargv); +} + #include "tst_lancelot.moc" |