logic: File Manager

* added FileManager that keeps track of the files analyzed by the project. It therefore checks if files get added, updated or deleted from the source- and include folders.
* refactored ASTVisitor::hasValidLocation() and implemented one version that search for the location in the currently parsed file and one that searches in all the project's source files.
* quickfix: switched order in FileManager so that header files are parsed first.
* created folder for helper classes used in tests.
* added test code for FileManager
* adjusted test code for Parser Tests.
This commit is contained in:
malte_langkabel
2015-02-09 14:52:31 +01:00
parent 4da51180ca
commit 8bc11c9d9c
43 changed files with 536 additions and 124 deletions
+17 -1
View File
@@ -5,7 +5,7 @@
#include <string>
#include <vector>
#include "utility/FileSystem.h"
#include "utility/file/FileSystem.h"
class FileSystemTestSuite : public CxxTest::TestSuite
{
@@ -71,6 +71,22 @@ public:
TS_ASSERT_EQUALS(sourceFiles[0], "data/FileSystemTestSuite/update.c");
}
void test_find_file_infos()
{
std::vector<std::string> extensions;
extensions.push_back(".h");
extensions.push_back(".hpp");
extensions.push_back(".cpp");
std::vector<std::string> directoryPaths;
directoryPaths.push_back("./data/FileSystemTestSuite");
std::vector<FileInfo> files =
FileSystem::getFileInfosFromDirectoryPaths(directoryPaths, extensions);
TS_ASSERT_EQUALS(files.size(), 5);
}
void test_filesystem_finds_existing_files()
{
TS_ASSERT(FileSystem::exists("data/FileSystemTestSuite"));