Commit b1ba6403 authored by Morten Volden's avatar Morten Volden

Fix defines and includes test to run on Windows.

Summary: Fix defines and includes test to run on Windows. Change the projects generator to use the 'new' way of generating project files. That way it's easier to handle the fact that we use different paths on different platforms.

Test Plan: Build on Windows and confirm that test is passing. Build on Linux and confirm that test (test_definesandincludes and test_compilerprovider since they both depend on projectgenerator ) still pass.

Reviewers: #kdevelop, kfunk

Reviewed By: #kdevelop, kfunk

Subscribers: kdevelop-devel

Tags: #kdevelop

Differential Revision: https://phabricator.kde.org/D17156
parent de81ab5c
......@@ -92,11 +92,13 @@ IProject* ProjectsGenerator::GenerateSimpleProject()
QTextStream stream( &file );
stream << "[Buildset]\n" <<
"BuildItems=@Variant(\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0b\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x1a\\x00S\\x00i\\x00m\\x00p\\x00l\\x00e\\x00P\\x00r\\x00o\\x00j\\x00e\\x00c\\x00t)\n" <<
"[CustomBuildSystem]\n" << "CurrentConfiguration=BuildConfig0\n" <<
"[CustomDefinesAndIncludes][ProjectPath0]\n" <<
"Defines=\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\x0c\\x00_\\x00D\\x00E\\x00B\\x00U\\x00G\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x10\\x00V\\x00A\\x00R\\x00I\\x00A\\x00B\\x00L\\x00E\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\n\\x00V\\x00A\\x00L\\x00U\\x00E\n" <<
"Includes=\\x00\\x00\\x00\\x01\\x00\\x00\\x00$\\x00/\\x00u\\x00s\\x00r\\x00/\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00/\\x00m\\x00y\\x00d\\x00i\\x00r\n" <<
"Path=/\n" <<
"[CustomDefinesAndIncludes][ProjectPath0][Defines]\n" <<
"_DEBUG=\n" <<
"VARIABLE=VALUE\n" <<
"[CustomDefinesAndIncludes][ProjectPath0][Includes]\n" <<
"1=" << QDir::rootPath() << "usr/include/mydir\n" <<
"[Project]\n" <<
"VersionControlSupport=\n";
}
......@@ -139,19 +141,23 @@ IProject* ProjectsGenerator::GenerateMultiPathProject()
QTextStream stream( &file );
stream << "[Buildset]\n" <<
"BuildItems=@Variant(\\x00\\x00\\x00\\t\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0b\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00 \\x00M\\x00u\\x00l\\x00t\\x00i\\x00P\\x00a\\x00t\\x00h\\x00P\\x00r\\x00o\\x00j\\x00e\\x00c\\x00t)\n" <<
"[CustomBuildSystem]\n" <<
"CurrentConfiguration=BuildConfig0\n" <<
"[CustomDefinesAndIncludes][ProjectPath0]\n" <<
"Defines=\\x00\\x00\\x00\\x02\\x00\\x00\\x00\\n\\x00_\\x00C\\x00O\\x00P\\x00Y\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x0c\\x00S\\x00O\\x00U\\x00R\\x00C\\x00E\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\x0e\\x00C\\x00O\\x00N\\x00T\\x00E\\x00N\\x00T\n" <<
"Includes=\\x00\\x00\\x00\\x01\\x00\\x00\\x00*\\x00/\\x00u\\x00s\\x00r\\x00/\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00/\\x00o\\x00t\\x00h\\x00e\\x00r\\x00d\\x00i\\x00r\n" <<
"Path=.\n" <<
"[CustomDefinesAndIncludes][ProjectPath0][Defines]\n" <<
"SOURCE=CONTENT\n" <<
"_COPY=\n" <<
"[CustomDefinesAndIncludes][ProjectPath0][Includes]\n" <<
"1=" << QDir::rootPath() << "usr/include/otherdir\n" <<
"[CustomDefinesAndIncludes][ProjectPath1]\n" <<
"Defines=\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\n\\x00B\\x00U\\x00I\\x00L\\x00D\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\n\\x00d\\x00e\\x00b\\x00u\\x00g\n" <<
"Includes=\\x00\\x00\\x00\\x01\\x00\\x00\\x000\\x00/\\x00u\\x00s\\x00r\\x00/\\x00l\\x00o\\x00c\\x00a\\x00l\\x00/\\x00i\\x00n\\x00c\\x00l\\x00u\\x00d\\x00e\\x00/\\x00m\\x00y\\x00d\\x00i\\x00r\n" <<
"Path=src\n" <<
"[CustomDefinesAndIncludes][ProjectPath1][Defines]\n" <<
"BUILD=debug\n" <<
"[CustomDefinesAndIncludes][ProjectPath1][Includes]\n" <<
"1=" << QDir::rootPath() << "usr/local/include/mydir\n" <<
"[CustomDefinesAndIncludes][ProjectPath2]\n" <<
"Defines=\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x0c\\x00H\\x00I\\x00D\\x00D\\x00E\\x00N\\x00\\x00\\x00\\n\\x00\\x00\\x00\\x00\\x00\n" <<
"Path=anotherFolder\n" <<
"[CustomDefinesAndIncludes][ProjectPath2][Defines]\n" <<
"HIDDEN=\n" <<
"[Project]\n" <<
"VersionControlSupport=\n";
}
......
......@@ -63,7 +63,7 @@ void TestDefinesAndIncludes::loadSimpleProject()
qDebug() << actualDefines << actualIncludes;
QCOMPARE( actualIncludes, Path::List() << Path( "/usr/include/mydir") );
QCOMPARE( actualIncludes, Path::List() << Path( QDir::rootPath() + QStringLiteral("usr/include/mydir") ) );
Defines defines;
defines.insert( QStringLiteral("_DEBUG"), QString() );
......@@ -80,7 +80,7 @@ void TestDefinesAndIncludes::loadMultiPathProject()
auto manager = IDefinesAndIncludesManager::manager();
QVERIFY( manager );
Path::List includes = Path::List() << Path(QStringLiteral("/usr/include/otherdir"));
Path::List includes = Path::List() << Path( QDir::rootPath() + QStringLiteral("usr/include/otherdir") );
QHash<QString,QString> defines;
defines.insert(QStringLiteral("SOURCE"), QStringLiteral("CONTENT"));
......@@ -102,7 +102,7 @@ void TestDefinesAndIncludes::loadMultiPathProject()
}
QVERIFY(mainfile);
includes.prepend(Path(QStringLiteral("/usr/local/include/mydir")));
includes.prepend(Path(QDir::rootPath() + QStringLiteral("usr/local/include/mydir")));
defines.insert(QStringLiteral("BUILD"), QStringLiteral("debug"));
qDebug() << includes << "VS" << manager->includes( mainfile, IDefinesAndIncludesManager::UserDefined );
qDebug() << mainfile << mainfile->path();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment