void ExternaltoolTest::testRead2()
{
    QString error;
    ExternalTool *tool = ExternalTool::createFromXml(QByteArray(TEST_XML2), &error);
    QVERIFY(tool != 0);
    QVERIFY(error.isEmpty());
    QCOMPARE(tool->id(), QString::fromLatin1("sort"));
    QVERIFY(tool->description().startsWith(QLatin1String("Sorts the")));
    QCOMPARE(tool->displayName(), QString::fromLatin1("Sort"));
    QCOMPARE(tool->displayCategory(), QString::fromLatin1("Text"));
    QCOMPARE(tool->order(), -1);
    QCOMPARE(tool->executables().size(), 1);
    QCOMPARE(tool->executables().at(0), QString::fromLatin1("sort"));
    QCOMPARE(tool->arguments(), QString());
    QCOMPARE(tool->input(), QString::fromLatin1("%{CurrentSelection}"));
    QCOMPARE(tool->workingDirectory(), QString::fromLatin1("%{CurrentPath}"));
    QCOMPARE(tool->outputHandling(), ExternalTool::ReplaceSelection);
    QCOMPARE(tool->errorHandling(), ExternalTool::ShowInPane);
    delete tool;
}
void ExternaltoolTest::testRead3()
{
    QString error;
    ExternalTool *tool = ExternalTool::createFromXml(QByteArray(TEST_XML3), &error);
    QVERIFY(tool != 0);
    QVERIFY(error.isEmpty());
    QCOMPARE(tool->id(), QString::fromLatin1("vi"));
    QVERIFY(tool->description().startsWith(QLatin1String("Opens the")));
    QCOMPARE(tool->displayName(), QString::fromLatin1("Edit with vi"));
    QCOMPARE(tool->displayCategory(), QString::fromLatin1("Text"));
    QCOMPARE(tool->order(), -1);
    QCOMPARE(tool->executables().size(), 1);
    QCOMPARE(tool->executables().at(0), QString::fromLatin1("xterm"));
    QVERIFY(tool->arguments().startsWith(QLatin1String("-geom %{")));
    QCOMPARE(tool->input(), QString());
    QCOMPARE(tool->workingDirectory(), QString::fromLatin1("%{CurrentPath}"));
    QCOMPARE(tool->outputHandling(), ExternalTool::ShowInPane);
    QCOMPARE(tool->modifiesCurrentDocument(), true);
    QCOMPARE(tool->errorHandling(), ExternalTool::ShowInPane);
    delete tool;
}
void ExternaltoolTest::testRead1()
{
    QString error;
    ExternalTool *tool = ExternalTool::createFromXml(QByteArray(TEST_XML1), &error);
    QVERIFY(tool != 0);
    QVERIFY(error.isEmpty());
    QCOMPARE(tool->id(), QString::fromLatin1("lupdate"));
    QVERIFY(tool->description().startsWith(QLatin1String("Synchronizes tran")));
    QCOMPARE(tool->displayName(), QString::fromLatin1("Update translations (lupdate)"));
    QCOMPARE(tool->displayCategory(), QString::fromLatin1("Linguist"));
    QCOMPARE(tool->order(), 1);
    QCOMPARE(tool->executables().size(), 2);
    QCOMPARE(tool->executables().at(0), QString::fromLatin1("%{QT_INSTALL_BINS}/lupdate"));
    QCOMPARE(tool->executables().at(1), QString::fromLatin1("lupdate"));
    QCOMPARE(tool->arguments(), QString::fromLatin1("%{CurrentProjectFilePath}"));
    QCOMPARE(tool->input(), QString());
    QCOMPARE(tool->workingDirectory(), QString::fromLatin1("%{CurrentProjectPath}"));
    QCOMPARE(tool->outputHandling(), ExternalTool::ShowInPane);
    QCOMPARE(tool->errorHandling(), ExternalTool::Ignore);
    delete tool;
}