diff --git a/src/tools/clangpchmanagerbackend/source/pchcreator.cpp b/src/tools/clangpchmanagerbackend/source/pchcreator.cpp index 84883aba53a..7ab04738eb6 100644 --- a/src/tools/clangpchmanagerbackend/source/pchcreator.cpp +++ b/src/tools/clangpchmanagerbackend/source/pchcreator.cpp @@ -275,9 +275,9 @@ Utils::SmallString PchCreator::generatePchIncludeFileContent( fileContent.reserve(includes.size() * lineTemplateSize + contentSize(includes)); for (const Utils::SmallString &include : includes) { - fileContent += "#include <"; + fileContent += "#include \""; fileContent += include; - fileContent += ">\n"; + fileContent += "\"\n"; } return fileContent; diff --git a/tests/unit/unittest/pchcreator-test.cpp b/tests/unit/unittest/pchcreator-test.cpp index df6e5764bb0..b4d3977c2fa 100644 --- a/tests/unit/unittest/pchcreator-test.cpp +++ b/tests/unit/unittest/pchcreator-test.cpp @@ -141,7 +141,7 @@ TEST_F(PchCreatorVerySlowTest, CreateGlobalPchFileContent) { auto content = creator.generateGlobalPchHeaderFileContent(); - ASSERT_THAT(content, "#include <" TESTDATA_DIR "/includecollector_external3.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/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 <" TESTDATA_DIR "/includecollector_external3.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/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) @@ -214,7 +214,7 @@ TEST_F(PchCreatorSlowTest, CreateProjectPartPchFileContent) auto content = creator.generatePchIncludeFileContent(includes); - ASSERT_THAT(content, "#include <" TESTDATA_DIR "/includecollector_header2.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/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 <" TESTDATA_DIR "/includecollector_header2.h>\n#include <" TESTDATA_DIR "/includecollector_external1.h>\n#include <" TESTDATA_DIR "/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)