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
+6 -2
View File
@@ -9,6 +9,8 @@
#include "utility/text/TextAccess.h"
#include "utility/utilityString.h"
#include "helper/TestFileManager.h"
class CxxParserTestSuite: public CxxTest::TestSuite
{
public:
@@ -1531,8 +1533,9 @@ public:
void test_cxx_parser_parses_multiple_files()
{
TestFileManager fm;
TestParserClient client;
CxxParser parser(&client);
CxxParser parser(&client, &fm);
std::vector<std::string> filePaths;
filePaths.push_back("data/CxxParserTestSuite/header.h");
@@ -1839,8 +1842,9 @@ private:
std::shared_ptr<TestParserClient> parseCode(std::string code) const
{
TestFileManager fm;
std::shared_ptr<TestParserClient> client = std::make_shared<TestParserClient>();
CxxParser parser(client.get());
CxxParser parser(client.get(), &fm);
parser.parseFile(TextAccess::createFromString(code));
return client;
}