Commit ecde742e authored by Halla Rempt's avatar Halla Rempt
Browse files

add exclusion option to the filetest

Some files can only be tested when certain plugins are installed.
Add an exclusion option which is now used to exclude ycbcr test
images from the tiff test if the ycbcr plugin isn't installed.

svn path=/trunk/koffice/; revision=1025573
parent 3bd868e9
......@@ -32,7 +32,7 @@
void KisJpegTest::testFiles()
{
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources");
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", QStringList());
}
QTEST_KDEMAIN(KisJpegTest, GUI)
......
......@@ -33,7 +33,7 @@
void KisPngTest::testFiles()
{
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources");
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", QStringList());
}
QTEST_KDEMAIN(KisPngTest, GUI)
......
......@@ -26,6 +26,9 @@
#include "filestest.h"
#include <KoColorSpaceRegistry.h>
#include <KoColorModelStandardIds.h>
#ifndef FILES_DATA_DIR
#error "FILES_DATA_DIR not set. A directory with the data used for testing the importing of files in krita"
#endif
......@@ -33,7 +36,11 @@
void KisTiffTest::testFiles()
{
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources");
QStringList excludes;
if(!KoColorSpaceRegistry::instance()->colorModelsList(KoColorSpaceRegistry::AllColorSpaces).contains(YCbCrAColorModelID)) {
excludes << "ycbcr-cat.tif";
}
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", excludes);
}
QTEST_KDEMAIN(KisTiffTest, GUI)
......
......@@ -43,7 +43,7 @@
namespace TestUtil
{
void testFiles(const QString& _dirname)
void testFiles(const QString& _dirname, const QStringList& exclusions)
{
QDir dirSources(_dirname);
qDebug() << "There are " << dirSources.entryInfoList().count() << " files in " << _dirname;
......@@ -53,8 +53,10 @@ namespace TestUtil
QStringList failuresCompare;
foreach(QFileInfo sourceFileInfo, dirSources.entryInfoList()) {
if (!sourceFileInfo.isHidden()) {
if (exclusions.contains(sourceFileInfo.fileName())) {
continue;
}
if (!sourceFileInfo.isHidden() ) {
qDebug() << "handling " << sourceFileInfo.fileName();
QFileInfo resultFileInfo(QString(FILES_DATA_DIR) + "/results/" + sourceFileInfo.fileName() + ".png");
......
......@@ -33,7 +33,7 @@
void KisFilesTest::testFiles()
{
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources");
TestUtil::testFiles(QString(FILES_DATA_DIR) + "/sources", QStringList());
}
QTEST_KDEMAIN(KisFilesTest, GUI)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment