Esempio n. 1
0
void TestFileList::addDirectory()
{
    FileList list;
    list.AddDirectory(QString(SRCDIR) + "/../data/files");
    QStringList files = list.GetFileList();
    QCOMPARE(files.size(), 7);
}
Esempio n. 2
0
void TestFileList::addDirectory_recursive()
{
    FileList list;
    list.AddDirectory(QString(SRCDIR) + "/../data/files", true);
    QStringList files = list.GetFileList();
    QCOMPARE(files.size(), 10);
    QDir dir(QString(SRCDIR) + "/../data/files");
    QString base = dir.canonicalPath();
    QVERIFY(files.contains(base + "/dir1/foo1.cpp"));
    QVERIFY(files.contains(base + "/dir1/dir11/foo11.cpp"));
    QVERIFY(files.contains(base + "/dir2/foo1.cpp"));
}
Esempio n. 3
0
void TestFileList::filterFiles4()
{
    FileList list;
    QStringList filters;
    filters << "dir1/";
    list.AddExcludeList(filters);
    list.AddDirectory(QString(SRCDIR) + "/../data/files", true);
    QStringList files = list.GetFileList();
    QCOMPARE(files.size(), 8);
    QDir dir(QString(SRCDIR) + "/../data/files");
    QString base = dir.canonicalPath();
    QVERIFY(! files.contains(base + "/dir1/foo1.cpp"));
    QVERIFY(! files.contains(base + "/dir1/dir11/foo11.cpp"));
}