From 76fad7aad0e2625dbca1415f7695a0697472db56 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Tue, 9 Oct 2018 11:02:22 +0200 Subject: Unittest: Fix compileroptionsbuilder-test paths on Linux Match paths partially not to construct the whole path. Change-Id: I397ac930e2d74b8eba98d1b523aabd4ed92f2aee Reviewed-by: Marco Bubke --- tests/unit/unittest/compileroptionsbuilder-test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/unittest/compileroptionsbuilder-test.cpp b/tests/unit/unittest/compileroptionsbuilder-test.cpp index 37d00dd676b..1ba52dd2939 100644 --- a/tests/unit/unittest/compileroptionsbuilder-test.cpp +++ b/tests/unit/unittest/compileroptionsbuilder-test.cpp @@ -41,7 +41,7 @@ using ProjectExplorer::Project; MATCHER_P(IsPartOfHeader, headerPart, std::string(negation ? "isn't " : "is ") + headerPart) { - return arg.contains(QString::fromUtf8(headerPart)); + return arg.contains(QString::fromStdString(headerPart)); } class CompilerOptionsBuilderTest : public ::testing::Test @@ -333,8 +333,8 @@ TEST_F(CompilerOptionsBuilderTest, BuildAllOptions) "-nostdlibinc", "-c", "-m64", "-target", "x86_64-apple-darwin10", "-arch", "x86_64", "-x", "c++", "-std=c++17", "-fcxx-exceptions", "-fexceptions", "-Dfoo=bar", "-DprojectFoo=projectBar", "-undef", - "-I", QDir::toNativeSeparators("D:/code/qt-creator/tests/unit/unittest/../../../share/qtcreator/cplusplus/wrappedQtHeaders"), - "-I", QDir::toNativeSeparators("D:/code/qt-creator/tests/unit/unittest/../../../share/qtcreator/cplusplus/wrappedQtHeaders/QtCore"), + "-I", IsPartOfHeader("wrappedQtHeaders"), + "-I", IsPartOfHeader(QDir::toNativeSeparators("wrappedQtHeaders/QtCore").toStdString()), "-I", QDir::toNativeSeparators("/tmp/path"), "-I", QDir::toNativeSeparators("/tmp/system_path"), "-isystem", QDir::toNativeSeparators("/tmp/builtin_path") -- cgit v1.2.3