summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative/examples
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2009-09-21 08:17:57 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2009-09-21 08:17:57 (GMT)
commitd890976c3c597575d5bac0e9f3c24865c643be3a (patch)
treee025655b7adb47cc0f05cdeff784efb7d213c5f8 /tests/auto/declarative/examples
parentb2c91170a17390db11a6782a91c9379ac157c1b3 (diff)
downloadQt-d890976c3c597575d5bac0e9f3c24865c643be3a.zip
Qt-d890976c3c597575d5bac0e9f3c24865c643be3a.tar.gz
Qt-d890976c3c597575d5bac0e9f3c24865c643be3a.tar.bz2
Allow paths to be excluded from test
Diffstat (limited to 'tests/auto/declarative/examples')
-rw-r--r--tests/auto/declarative/examples/tst_examples.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/examples/tst_examples.cpp b/tests/auto/declarative/examples/tst_examples.cpp
index d65247a..51f6e5f 100644
--- a/tests/auto/declarative/examples/tst_examples.cpp
+++ b/tests/auto/declarative/examples/tst_examples.cpp
@@ -16,6 +16,7 @@ private slots:
void namingConvention();
private:
QString qmlviewer;
+ QStringList excludedDirs;
void namingConvention(const QDir &);
QStringList findQmlFiles(const QDir &);
@@ -32,6 +33,10 @@ tst_examples::tst_examples()
#else
qmlviewer = QDir(binaries).absoluteFilePath("qmlviewer");
#endif
+
+
+ // Add directories you want excluded here
+ excludedDirs << "examples/declarative/extending";
}
/*
@@ -40,6 +45,12 @@ to have them tested by the examples() test.
*/
void tst_examples::namingConvention(const QDir &d)
{
+ for (int ii = 0; ii < excludedDirs.count(); ++ii) {
+ QString s = QDir::toNativeSeparators(excludedDirs.at(ii));
+ if (d.absolutePath().endsWith(s))
+ return;
+ }
+
QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),
QDir::Files);
@@ -75,6 +86,12 @@ void tst_examples::namingConvention()
QStringList tst_examples::findQmlFiles(const QDir &d)
{
+ for (int ii = 0; ii < excludedDirs.count(); ++ii) {
+ QString s = QDir::toNativeSeparators(excludedDirs.at(ii));
+ if (d.absolutePath().endsWith(s))
+ return QStringList();
+ }
+
QStringList rv;
QStringList files = d.entryList(QStringList() << QLatin1String("*.qml"),