From 1e3e41da52a5f521addd59779c9fd4275e80d6b2 Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Thu, 15 Sep 2022 15:56:36 +0200 Subject: [PATCH] CppEditor: Fix test expectations Amends ec1905c6fad3bbfe. Change-Id: I6fc886ed87ddad46396fd728ca09f430cc3a4d65 Reviewed-by: Christian Kandeler --- .../cppeditor/compileroptionsbuilder_test.cpp | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/src/plugins/cppeditor/compileroptionsbuilder_test.cpp b/src/plugins/cppeditor/compileroptionsbuilder_test.cpp index 6131ce5f023..65c4a3757e3 100644 --- a/src/plugins/cppeditor/compileroptionsbuilder_test.cpp +++ b/src/plugins/cppeditor/compileroptionsbuilder_test.cpp @@ -213,8 +213,8 @@ void CompilerOptionsBuilderTest::testHeaderPathOptionsOrder() compilerOptionsBuilder.addHeaderPathOptions(); QCOMPARE(compilerOptionsBuilder.options(), - (QStringList{"-nostdinc", "-nostdinc++", "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), "-isystem", t.toNative("/dummy"), + (QStringList{"-nostdinc", "-nostdinc++", "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "-isystem", t.toNative("/dummy"), "-isystem", t.toNative("/tmp/builtin_path")})); } @@ -229,8 +229,8 @@ void CompilerOptionsBuilderTest::testHeaderPathOptionsOrderMsvc() compilerOptionsBuilder.addHeaderPathOptions(); QCOMPARE(compilerOptionsBuilder.options(), - (QStringList{"-nostdinc", "-nostdinc++", "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), "/clang:-isystem", + (QStringList{"-nostdinc", "-nostdinc++", "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "/clang:-isystem", "/clang:" + t.toNative("/dummy"), "/clang:-isystem", "/clang:" + t.toNative("/tmp/builtin_path")})); } @@ -244,7 +244,7 @@ void CompilerOptionsBuilderTest::testUseSystemHeader() compilerOptionsBuilder.addHeaderPathOptions(); QCOMPARE(compilerOptionsBuilder.options(), - (QStringList{"-nostdinc", "-nostdinc++", "-I", t.toNative("/tmp/path"), + (QStringList{"-nostdinc", "-nostdinc++", "-I" + t.toNative("/tmp/path"), "-isystem", t.toNative("/tmp/system_path"), "-isystem", t.toNative("/dummy"), "-isystem", t.toNative("/tmp/builtin_path")})); @@ -257,7 +257,7 @@ void CompilerOptionsBuilderTest::testNoClangHeadersPath() t.compilerOptionsBuilder->addHeaderPathOptions(); QCOMPARE(t.compilerOptionsBuilder->options(), - (QStringList{"-I", t.toNative("/tmp/path"), "-I", t.toNative("/tmp/system_path")})); + (QStringList{"-I" + t.toNative("/tmp/path"), "-I" + t.toNative("/tmp/system_path")})); } void CompilerOptionsBuilderTest::testClangHeadersAndCppIncludePathsOrderMacOs() @@ -277,8 +277,8 @@ void CompilerOptionsBuilderTest::testClangHeadersAndCppIncludePathsOrderMacOs() compilerOptionsBuilder.addHeaderPathOptions(); QCOMPARE(compilerOptionsBuilder.options(), - (QStringList{"-nostdinc", "-nostdinc++", "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), + (QStringList{"-nostdinc", "-nostdinc++", "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "-isystem", t.toNative("/usr/include/c++/4.2.1"), "-isystem", t.toNative("/usr/include/c++/4.2.1/backward"), "-isystem", t.toNative("/usr/local/include"), @@ -610,10 +610,11 @@ void CompilerOptionsBuilderTest::testBuildAllOptions() QCOMPARE(compilerOptionsBuilder.options(), (QStringList{"-nostdinc", "-nostdinc++", "-arch", "x86_64", "-fsyntax-only", "-m64", "--target=x86_64-apple-darwin10", "-x", "c++", "-std=c++17", - "-DprojectFoo=projectBar", "-I", wrappedQtHeadersPath, - "-I", wrappedQtCoreHeadersPath, - "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), + "-DprojectFoo=projectBar", + wrappedQtHeadersPath, // contains -I already + wrappedQtCoreHeadersPath, // contains -I already + "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "-isystem", t.toNative("/dummy"), "-isystem", t.toNative("/tmp/builtin_path")})); } @@ -638,10 +639,10 @@ void CompilerOptionsBuilderTest::testBuildAllOptionsMsvc() "-D__FUNCSIG__=\"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\"", "-D__FUNCTION__=\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\"", "-D__FUNCDNAME__=\"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\"", - "-I", wrappedQtHeadersPath, - "-I", wrappedQtCoreHeadersPath, - "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), + wrappedQtHeadersPath, // contains -I already + wrappedQtCoreHeadersPath, // contains -I already + "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "/clang:-isystem", "/clang:" + t.toNative("/dummy"), "/clang:-isystem", "/clang:" + t.toNative("/tmp/builtin_path")})); } @@ -668,10 +669,10 @@ void CompilerOptionsBuilderTest::testBuildAllOptionsMsvcWithExceptions() "-D__FUNCSIG__=\"void __cdecl someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580(void)\"", "-D__FUNCTION__=\"someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580\"", "-D__FUNCDNAME__=\"?someLegalAndLongishFunctionNameThatWorksAroundQTCREATORBUG-24580@@YAXXZ\"", - "-I", wrappedQtHeadersPath, - "-I", wrappedQtCoreHeadersPath, - "-I", t.toNative("/tmp/path"), - "-I", t.toNative("/tmp/system_path"), + wrappedQtHeadersPath, // contains -I already + wrappedQtCoreHeadersPath, // contains -I already + "-I" + t.toNative("/tmp/path"), + "-I" + t.toNative("/tmp/system_path"), "/clang:-isystem", "/clang:" + t.toNative("/dummy"), "/clang:-isystem", "/clang:" + t.toNative("/tmp/builtin_path")})); }