From 40dba7ed0d1389ec811efab2c95498521084f519 Mon Sep 17 00:00:00 2001 From: Janick Bernet Date: Thu, 22 Dec 2011 12:00:29 +0100 Subject: [PATCH 2/2] Fixed tests. --- tests/tests.cpp | 70 +++++++++++++++++++++++++++--------------------------- 1 files changed, 35 insertions(+), 35 deletions(-) diff --git a/tests/tests.cpp b/tests/tests.cpp index a387381..875b602 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -389,7 +389,7 @@ void ParserTest::descriptionBlocks() QCOMPARE(target->m_commands.count(), 1); Command cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo one")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo one")); target = mkfile->target("two"); QVERIFY(target != 0); @@ -397,7 +397,7 @@ void ParserTest::descriptionBlocks() QCOMPARE(target->m_commands.count(), 1); cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo two")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo two")); target = mkfile->target("three"); QVERIFY(target != 0); @@ -405,30 +405,30 @@ void ParserTest::descriptionBlocks() QCOMPARE(target->m_commands.count(), 1); cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo three; @echo end of three")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo three; @echo end of three")); target = mkfile->target("."); QVERIFY(target != 0); QCOMPARE(target->m_dependents.count(), 0); QCOMPARE(target->m_commands.count(), 1); cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo directory . doesn't exist. That's strange.")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo directory . doesn't exist. That's strange.")); target = mkfile->target(".."); QVERIFY(target != 0); QCOMPARE(target->m_dependents.count(), 0); QCOMPARE(target->m_commands.count(), 1); cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo directory .. doesn't exist. That's strange.")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo directory .. doesn't exist. That's strange.")); target = mkfile->target(QLatin1String("dollarSigns")); QVERIFY(target != 0); QCOMPARE(target->m_dependents.count(), 0); QCOMPARE(target->m_commands.count(), 2); cmd = target->m_commands.takeFirst(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo ($dollar-signs$)")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo ($dollar-signs$)")); cmd = target->m_commands.first(); - QCOMPARE(cmd.m_commandLine, QLatin1String("echo $(dollar-signs)$")); + QCOMPARE(cmd.m_commandLine, QLatin1String("@echo $(dollar-signs)$")); target = mkfile->target(QLatin1String("SubstitutedTargetName")); QVERIFY(target != 0); @@ -450,13 +450,13 @@ void ParserTest::inferenceRules_data() QTest::addColumn("fileToCreate"); QTest::newRow("init") << IRTM_Init << "" << "" << ""; - QTest::newRow("1") << IRTM_ParseTimeRule << "foo1.obj" << "echo {subdir}.cpp.obj (subdir\\foo1.cpp)" << ""; - QTest::newRow("2") << IRTM_ParseTimeRule << "foo2.obj" << "echo {subdir}.cpp.obj (subdir\\foo2.cpp)" << ""; - QTest::newRow("3") << IRTM_ParseTimeRule << "foo3.obj" << "echo .cpp.obj (foo3.cpp)" << ""; - QTest::newRow("4") << IRTM_ParseTimeRule << "foo4.obj" << "echo {subdir}.cpp.obj (subdir\\foo4.cpp)" << ""; - QTest::newRow("5") << IRTM_DeferredRule << "foo5.obj" << "echo {subdir}.cpp.obj (subdir\\foo5.cpp)" << "subdir\\foo5.cpp"; - QTest::newRow("6") << IRTM_DeferredRule << "foo6.obj" << "echo .cpp.obj (foo6.cpp)" << "foo6.cpp"; - QTest::newRow("7") << IRTM_DeferredRule << "foo.bar.obj" << "echo .cpp.obj (foo.bar.cpp)" << "foo.bar.cpp"; + QTest::newRow("1") << IRTM_ParseTimeRule << "foo1.obj" << "@echo {subdir}.cpp.obj (subdir\\foo1.cpp)" << ""; + QTest::newRow("2") << IRTM_ParseTimeRule << "foo2.obj" << "@echo {subdir}.cpp.obj (subdir\\foo2.cpp)" << ""; + QTest::newRow("3") << IRTM_ParseTimeRule << "foo3.obj" << "@echo .cpp.obj (foo3.cpp)" << ""; + QTest::newRow("4") << IRTM_ParseTimeRule << "foo4.obj" << "@echo {subdir}.cpp.obj (subdir\\foo4.cpp)" << ""; + QTest::newRow("5") << IRTM_DeferredRule << "foo5.obj" << "@echo {subdir}.cpp.obj (subdir\\foo5.cpp)" << "subdir\\foo5.cpp"; + QTest::newRow("6") << IRTM_DeferredRule << "foo6.obj" << "@echo .cpp.obj (foo6.cpp)" << "foo6.cpp"; + QTest::newRow("7") << IRTM_DeferredRule << "foo.bar.obj" << "@echo .cpp.obj (foo.bar.cpp)" << "foo.bar.cpp"; QTest::newRow("cleanup") << IRTM_Cleanup << "" << "" << ""; QStringList filesToCreate; @@ -636,26 +636,26 @@ void ParserTest::fileNameMacros() target->expandFileNameMacros(); QCOMPARE(target->m_commands.count(), 2); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo $@")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo $@")); command = target->m_commands.first(); - QCOMPARE(command.m_commandLine, QLatin1String("echo Football Football")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo Football Football")); target = mkfile->target(QLatin1String("LolCatExtractorManager.tar.gz")); QVERIFY(target); target->expandFileNameMacros(); QVERIFY(!target->m_commands.isEmpty()); command = target->m_commands.first(); - QCOMPARE(command.m_commandLine, QLatin1String("echo LolCatExtractorManager.tar")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo LolCatExtractorManager.tar")); target = mkfile->target(QLatin1String("manyDependents")); QVERIFY(target); target->expandFileNameMacros(); QVERIFY(!target->m_commands.isEmpty()); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo Timmy Jimmy Kenny Eric Kyle Stan")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo Timmy Jimmy Kenny Eric Kyle Stan")); QVERIFY(!target->m_commands.isEmpty()); command = target->m_commands.first(); - QCOMPARE(command.m_commandLine, QLatin1String("echo Timmy Jimmy Kenny Eric Kyle Stan")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo Timmy Jimmy Kenny Eric Kyle Stan")); target = mkfile->target(QLatin1String("manyDependentsSingleExecution")); QVERIFY(target); @@ -666,7 +666,7 @@ void ParserTest::fileNameMacros() foreach (const QString& str, lst) { QVERIFY(!target->m_commands.isEmpty()); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QString(QLatin1String("echo ") + str)); + QCOMPARE(command.m_commandLine, QString(QLatin1String("@echo ") + str)); } target = mkfile->target(QLatin1String("manyDependentsSubstitutedNames")); @@ -674,13 +674,13 @@ void ParserTest::fileNameMacros() target->expandFileNameMacros(); QCOMPARE(target->m_commands.size(), 4); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo $(**) Tilly Jilly")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo $(**) Tilly Jilly")); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo $(?) Tilly Jilly")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo $(?) Tilly Jilly")); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo $(**:ll=mm) Timmy Jimmy")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo $(**:ll=mm) Timmy Jimmy")); command = target->m_commands.takeFirst(); - QCOMPARE(command.m_commandLine, QLatin1String("echo $(?:ll=mm) Timmy Jimmy")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo $(?:ll=mm) Timmy Jimmy")); target = mkfile->target(QLatin1String("manyDependentsInlineFile")); QVERIFY(target); @@ -706,7 +706,7 @@ void ParserTest::fileNameMacros() target->expandFileNameMacros(); QVERIFY(!target->m_commands.isEmpty()); command = target->m_commands.first(); - QCOMPARE(command.m_commandLine, QLatin1String("echo gen2.txt gen3.txt")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo gen2.txt gen3.txt")); target = mkfile->target(QLatin1String("gen_cleanup")); QVERIFY(target); @@ -719,13 +719,13 @@ void ParserTest::fileNameMacros() target->expandFileNameMacros(); QCOMPARE(target->m_commands.count(), 4); command = target->m_commands.at(0); - QCOMPARE(command.m_commandLine, QLatin1String("echo .")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo .")); command = target->m_commands.at(1); - QCOMPARE(command.m_commandLine, QLatin1String("echo macros")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo macros")); command = target->m_commands.at(2); - QCOMPARE(command.m_commandLine, QLatin1String("echo macros.mk")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo macros.mk")); command = target->m_commands.at(3); - QCOMPARE(command.m_commandLine, QLatin1String("echo macros")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo macros")); const QString currentPath = QDir::currentPath().replace('/', '\\'); target = mkfile->target(currentPath + QLatin1String("\\infrules.mk")); @@ -733,22 +733,22 @@ void ParserTest::fileNameMacros() target->expandFileNameMacros(); QCOMPARE(target->m_commands.count(), 4); command = target->m_commands.at(0); - QCOMPARE(command.m_commandLine, QString(QLatin1String("echo ") + currentPath)); + QCOMPARE(command.m_commandLine, QString(QLatin1String("@echo ") + currentPath)); command = target->m_commands.at(1); - QCOMPARE(command.m_commandLine, QLatin1String("echo infrules")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo infrules")); command = target->m_commands.at(2); - QCOMPARE(command.m_commandLine, QLatin1String("echo infrules.mk")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo infrules.mk")); command = target->m_commands.at(3); - QCOMPARE(command.m_commandLine, QString(QLatin1String("echo ") + currentPath + QLatin1String("\\infrules"))); + QCOMPARE(command.m_commandLine, QString(QLatin1String("@echo ") + currentPath + QLatin1String("\\infrules"))); target = mkfile->target("root_dir\\substitutionWithColon"); QVERIFY(target); target->expandFileNameMacros(); QCOMPARE(target->m_commands.count(), 2); command = target->m_commands.at(0); - QCOMPARE(command.m_commandLine, QLatin1String("echo C:\\somewhere\\substitutionWithColon")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo C:\\somewhere\\substitutionWithColon")); command = target->m_commands.at(1); - QCOMPARE(command.m_commandLine, QLatin1String("echo C:\\somewhere\\substitutionWithColon")); + QCOMPARE(command.m_commandLine, QLatin1String("@echo C:\\somewhere\\substitutionWithColon")); } void ParserTest::fileNameMacrosInDependents() -- 1.7.4.msysgit.0