summaryrefslogtreecommitdiffstats
path: root/tests
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
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')
-rw-r--r--tests/auto/declarative/examples/data/webbrowser/webbrowser.qml6
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp8
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
new file mode 100644
index 0000000..bdf3290
--- /dev/null
+++ b/tests/auto/declarative/examples/data/webbrowser/webbrowser.qml
@@ -0,0 +1,6 @@
+import Qt.VisualTest 4.6
+
+VisualTest {
+ Frame { msec: 0 }
+ Frame { msec: 1000 }
+}
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);