diff --git a/gui/test/test.pro b/gui/test/test.pro index ac562b2ef..42a0db3f9 100644 --- a/gui/test/test.pro +++ b/gui/test/test.pro @@ -2,4 +2,5 @@ CONFIG += ordered TEMPLATE = subdirs SUBDIRS = translationhandler \ - xmlreport + xmlreport \ + xmlreportv1 diff --git a/gui/test/testxmlreportv1.cpp b/gui/test/xmlreportv1/testxmlreportv1.cpp similarity index 84% rename from gui/test/testxmlreportv1.cpp rename to gui/test/xmlreportv1/testxmlreportv1.cpp index 1c0ad3187..2bcf0feb2 100644 --- a/gui/test/testxmlreportv1.cpp +++ b/gui/test/xmlreportv1/testxmlreportv1.cpp @@ -1,6 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2011 Daniel Marjamäki and Cppcheck team. + * Copyright (C) 2007-2011 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,10 +21,11 @@ #include "testxmlreportv1.h" #include "xmlreportv1.h" #include "erroritem.h" +#include "errorlogger.h" void TestXmlReportV1::readXml() { - const QString filepath("xmlfiles/xmlreport_v1.xml"); + const QString filepath("../xmlfiles/xmlreport_v1.xml"); XmlReportV1 report(filepath); QVERIFY(report.Open()); QList errors = report.Read(); @@ -34,7 +35,9 @@ void TestXmlReportV1::readXml() QCOMPARE(item.file, QString("test.cxx")); QCOMPARE(item.lines[0], (unsigned int)11); QCOMPARE(item.id, QString("unreadVariable")); - QCOMPARE(item.severity, QString("Style")); + QCOMPARE(GuiSeverity::toString(item.severity), QString("Style")); QCOMPARE(item.summary, QString("Variable 'a' is assigned a value that is never used")); QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used")); } + +QTEST_MAIN(TestXmlReportV1) diff --git a/gui/test/testxmlreportv1.h b/gui/test/xmlreportv1/testxmlreportv1.h similarity index 92% rename from gui/test/testxmlreportv1.h rename to gui/test/xmlreportv1/testxmlreportv1.h index ada1bc640..ee8ea0fb5 100644 --- a/gui/test/testxmlreportv1.h +++ b/gui/test/xmlreportv1/testxmlreportv1.h @@ -1,6 +1,6 @@ /* * Cppcheck - A tool for static C/C++ code analysis - * Copyright (C) 2007-2011 Daniel Marjamäki and Cppcheck team. + * Copyright (C) 2007-2011 Daniel Marjamäki and Cppcheck team. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/gui/test/xmlreportv1/xmlreportv1.pro b/gui/test/xmlreportv1/xmlreportv1.pro new file mode 100644 index 000000000..d7883ee86 --- /dev/null +++ b/gui/test/xmlreportv1/xmlreportv1.pro @@ -0,0 +1,13 @@ +TEMPLATE = app +TARGET = test-xmlreportv1 +DEPENDPATH += . +INCLUDEPATH += . +OBJECTS_DIR = build +MOC_DIR = build + +include(../common.pri) + +# tests +SOURCES += testxmlreportv1.cpp + +HEADERS += testxmlreportv1.h