summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/examples/tst_examples.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-03 06:45:59 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-03 06:46:53 (GMT)
commited82a5dbe57fcc80b9d6244c73295f4b0b6e2835 (patch)
tree3d029c4f2c0f14b18f47c9f682456a6f2eba19d0 /tests/auto/declarative/examples/tst_examples.cpp
parent5f19daab6baba7d09853058355a66090a3781430 (diff)
downloadQt-ed82a5dbe57fcc80b9d6244c73295f4b0b6e2835.zip
Qt-ed82a5dbe57fcc80b9d6244c73295f4b0b6e2835.tar.gz
Qt-ed82a5dbe57fcc80b9d6244c73295f4b0b6e2835.tar.bz2
Allow example-specific test.
Allow examples to report failure via error property. Workaround QTBUG-5296 by running webbrowser demo for longer.
Diffstat (limited to 'tests/auto/declarative/examples/tst_examples.cpp')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index ac12204..d758101 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -42,6 +42,7 @@
#include <QLibraryInfo>
#include <QDir>
#include <QProcess>
+#include <QDebug>
class tst_examples : public QObject
{
@@ -179,9 +180,12 @@ void tst_examples::examples()
{
QFETCH(QString, file);
+ QFileInfo fi(file);
+ QFileInfo dir(fi.path());
+ QFileInfo testdata("data/"+dir.baseName()+"/"+fi.baseName());
QStringList arguments;
- arguments << "-script" << "data/dummytest"
- << "-scriptopts" << "play,exitoncomplete,exitonfailure"
+ arguments << "-script" << (testdata.exists() ? testdata.filePath() : QLatin1String("data/dummytest"))
+ << "-scriptopts" << "play,testerror,exitoncomplete,exitonfailure"
<< file;
QProcess p;
p.start(qmlviewer, arguments);