void TestFileList::addDirectory() { FileList list; list.AddDirectory(QString(SRCDIR) + "/../data/files"); QStringList files = list.GetFileList(); QCOMPARE(files.size(), 7); }
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")); }
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")); }