summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2017-02-02 11:46:19 +0100
committerMarco Bubke <marco.bubke@qt.io>2017-02-02 12:46:20 +0000
commit5c7f49f27841a4620fc6708d1c5fedce7c4eeca2 (patch)
tree71a5b9a5b6791ff4275c3f85105919cd20cd92d4 /tests/unit
parentbdfb466cd26b82e76bcdccab9ad3f924add89eb5 (diff)
downloadqt-creator-5c7f49f27841a4620fc6708d1c5fedce7c4eeca2.tar.gz
Clang: Use the whole path in the IncludeCollector
Change-Id: I406f0050b0c244b6c0d1352b5889d4e65a43fa33 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/unittest/includecollector-test.cpp14
-rw-r--r--tests/unit/unittest/pchcreator-test.cpp34
2 files changed, 24 insertions, 24 deletions
diff --git a/tests/unit/unittest/includecollector-test.cpp b/tests/unit/unittest/includecollector-test.cpp
index 50c0529e78..663de3fedd 100644
--- a/tests/unit/unittest/includecollector-test.cpp
+++ b/tests/unit/unittest/includecollector-test.cpp
@@ -52,15 +52,15 @@ TEST_F(IncludeCollector, IncludesExternalHeader)
collector.collectIncludes();
ASSERT_THAT(collector.takeIncludeIds(),
- AllOf(Contains(id("includecollector_external1.h")),
- Contains(id("../data/includecollector_external2.h"))));
+ AllOf(Contains(id(TESTDATA_DIR "/includecollector_external1.h")),
+ Contains(id(TESTDATA_DIR "/../data/includecollector_external2.h"))));
}
TEST_F(IncludeCollector, DoesNotIncludesInternalHeader)
{
collector.collectIncludes();
- ASSERT_THAT(collector.takeIncludeIds(), Not(Contains(id("includecollector_header1.h"))));
+ ASSERT_THAT(collector.takeIncludeIds(), Not(Contains(id(TESTDATA_DIR "/includecollector_header1.h"))));
}
TEST_F(IncludeCollector, NoDuplicate)
@@ -68,8 +68,8 @@ TEST_F(IncludeCollector, NoDuplicate)
collector.collectIncludes();
ASSERT_THAT(collector.takeIncludeIds(),
- UnorderedElementsAre(id("includecollector_external1.h"),
- id("../data/includecollector_external2.h")));
+ UnorderedElementsAre(id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/../data/includecollector_external2.h")));
}
TEST_F(IncludeCollector, IncludesAreSorted)
@@ -77,8 +77,8 @@ TEST_F(IncludeCollector, IncludesAreSorted)
collector.collectIncludes();
ASSERT_THAT(collector.takeIncludeIds(),
- ElementsAre(id("includecollector_external1.h"),
- id("../data/includecollector_external2.h")));
+ ElementsAre(id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/../data/includecollector_external2.h")));
}
void IncludeCollector::SetUp()
diff --git a/tests/unit/unittest/pchcreator-test.cpp b/tests/unit/unittest/pchcreator-test.cpp
index 668704c315..df6e5764bb 100644
--- a/tests/unit/unittest/pchcreator-test.cpp
+++ b/tests/unit/unittest/pchcreator-test.cpp
@@ -132,16 +132,16 @@ TEST_F(PchCreatorVerySlowTest, CreateGlobalPchIncludes)
auto includeIds = creator.generateGlobalPchIncludeIds();
ASSERT_THAT(includeIds,
- UnorderedElementsAre(id("includecollector_external3.h"),
- id("includecollector_external1.h"),
- id("includecollector_external2.h")));
+ UnorderedElementsAre(id(TESTDATA_DIR "/includecollector_external3.h"),
+ id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/includecollector_external2.h")));
}
TEST_F(PchCreatorVerySlowTest, CreateGlobalPchFileContent)
{
auto content = creator.generateGlobalPchHeaderFileContent();
- ASSERT_THAT(content, "#include <includecollector_external3.h>\n#include <includecollector_external1.h>\n#include <includecollector_external2.h>\n");
+ ASSERT_THAT(content, "#include <" TESTDATA_DIR "/includecollector_external3.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/includecollector_external2.h>\n");
}
TEST_F(PchCreatorVerySlowTest, CreateGlobalPchHeaderFile)
@@ -151,7 +151,7 @@ TEST_F(PchCreatorVerySlowTest, CreateGlobalPchHeaderFile)
auto content = file->readAll();
- ASSERT_THAT(content, "#include <includecollector_external3.h>\n#include <includecollector_external1.h>\n#include <includecollector_external2.h>\n");
+ ASSERT_THAT(content, "#include <" TESTDATA_DIR "/includecollector_external3.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/includecollector_external2.h>\n");
}
TEST_F(PchCreator, ConvertToQStringList)
@@ -203,9 +203,9 @@ TEST_F(PchCreatorSlowTest, CreateProjectPartPchIncludes)
{
auto includeIds = creator.generateProjectPartPchIncludes(projectPart1);
- ASSERT_THAT(includeIds, UnorderedElementsAre(id("includecollector_external1.h"),
- id("includecollector_external2.h"),
- id("includecollector_header2.h")));
+ ASSERT_THAT(includeIds, UnorderedElementsAre(id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/includecollector_external2.h"),
+ id(TESTDATA_DIR "/includecollector_header2.h")));
}
TEST_F(PchCreatorSlowTest, CreateProjectPartPchFileContent)
@@ -214,7 +214,7 @@ TEST_F(PchCreatorSlowTest, CreateProjectPartPchFileContent)
auto content = creator.generatePchIncludeFileContent(includes);
- ASSERT_THAT(content, "#include <includecollector_header2.h>\n#include <includecollector_external1.h>\n#include <includecollector_external2.h>\n");
+ ASSERT_THAT(content, "#include <" TESTDATA_DIR "/includecollector_header2.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/includecollector_external2.h>\n");
}
TEST_F(PchCreatorSlowTest, CreateProjectPartPchIncludeFile)
@@ -227,7 +227,7 @@ TEST_F(PchCreatorSlowTest, CreateProjectPartPchIncludeFile)
auto fileContent = file->readAll();
- ASSERT_THAT(fileContent, "#include <includecollector_header2.h>\n#include <includecollector_external1.h>\n#include <includecollector_external2.h>\n");
+ ASSERT_THAT(fileContent, "#include <" TESTDATA_DIR "/includecollector_header2.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/includecollector_external2.h>\n");
}
TEST_F(PchCreator, CreateProjectPartPchCompilerArguments)
@@ -303,14 +303,14 @@ TEST_F(PchCreatorVerySlowTest, IdPathsForCreatePchsForProjectParts)
ASSERT_THAT(creator.takeProjectsIncludes(),
ElementsAre(AllOf(Field(&IdPaths::id, "project1"),
- Field(&IdPaths::paths, UnorderedElementsAre(id("includecollector_header2.h"),
- id("includecollector_external1.h"),
- id("includecollector_external2.h")))),
+ Field(&IdPaths::paths, UnorderedElementsAre(id(TESTDATA_DIR "/includecollector_header2.h"),
+ id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/includecollector_external2.h")))),
AllOf(Field(&IdPaths::id, "project2"),
- Field(&IdPaths::paths, UnorderedElementsAre(id("includecollector_external1.h"),
- id("includecollector_external3.h"),
- id("includecollector_header1.h"),
- id("../data/includecollector_external2.h"))))));
+ Field(&IdPaths::paths, UnorderedElementsAre(id(TESTDATA_DIR "/includecollector_external1.h"),
+ id(TESTDATA_DIR "/includecollector_external3.h"),
+ id(TESTDATA_DIR "/includecollector_header1.h"),
+ id(TESTDATA_DIR "/../data/includecollector_external2.h"))))));
}
uint PchCreator::id(const Utils::SmallString &path)