summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-12 04:11:32 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-14 01:02:12 (GMT)
commitca64874f1a9f6453a0bd5a0f6b8ae61d49900314 (patch)
tree5fbede3c74dec49e4a443fc7f98edbb80071988a /tests/auto/declarative
parentb16e6e70529b8ef86734324c6c6a0e151ddf4bc8 (diff)
downloadQt-ca64874f1a9f6453a0bd5a0f6b8ae61d49900314.zip
Qt-ca64874f1a9f6453a0bd5a0f6b8ae61d49900314.tar.gz
Qt-ca64874f1a9f6453a0bd5a0f6b8ae61d49900314.tar.bz2
Support recording visual snapshot tests.
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
index 05c2ebd..718e3a6 100644
--- a/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
+++ b/tests/auto/declarative/qmlvisual/tst_qmlvisual.cpp
@@ -47,7 +47,7 @@
#include <QProcess>
#include <QFile>
-enum Mode { Record, RecordNoVisuals, Play, TestVisuals, RemoveVisuals, UpdateVisuals, UpdatePlatformVisuals, Test };
+enum Mode { Record, RecordNoVisuals, RecordSnapshot, Play, TestVisuals, RemoveVisuals, UpdateVisuals, UpdatePlatformVisuals, Test };
static QString testdir;
class tst_qmlvisual : public QObject
@@ -133,7 +133,7 @@ void tst_qmlvisual::visual()
QStringList arguments;
arguments << "-script" << testdata
<< "-scriptopts" << "play,testimages,testerror,exitoncomplete,exitonfailure"
- << file << "-graphicssystem" << "raster";
+ << file;
#ifdef Q_WS_QWS
arguments << "-qws";
#endif
@@ -246,6 +246,11 @@ void action(Mode mode, const QString &file)
<< "-scriptopts" << "record,saveonexit"
<< file;
break;
+ case RecordSnapshot:
+ arguments << "-script" << testdata
+ << "-scriptopts" << "record,testimages,snapshot,saveonexit"
+ << file;
+ break;
case Play:
arguments << "-script" << testdata
<< "-scriptopts" << "play,testimages,testerror,exitoncomplete"
@@ -283,6 +288,7 @@ void usage()
fprintf(stderr, " -listtests : list all the tests seen by tst_qmlvisual, and then exit immediately\n");
fprintf(stderr, " -record file : record new test data for file\n");
fprintf(stderr, " -recordnovisuals file : record new test data for file, but ignore visuals\n");
+ fprintf(stderr, " -recordsnapshot file : record new snapshot for file (like record but only records a single frame and then exits)\n");
fprintf(stderr, " -play file : playback test data for file, printing errors\n");
fprintf(stderr, " -testvisuals file : playback test data for file, without errors\n");
fprintf(stderr, " -updatevisuals file : playback test data for file, accept new visuals for file\n");
@@ -340,6 +346,9 @@ int main(int argc, char **argv)
} else if (arg == "-recordnovisuals" && (ii + 1) < argc) {
mode = RecordNoVisuals;
file = argv[++ii];
+ } else if (arg == "-recordsnapshot" && (ii + 1) < argc) {
+ mode = RecordSnapshot;
+ file = argv[++ii];
} else if (arg == "-testvisuals" && (ii + 1) < argc) {
mode = TestVisuals;
file = argv[++ii];