GUITESTS: Move XML format V1 tests to own project.

This commit is contained in:
Kimmo Varis 2011-06-10 14:01:08 +03:00
parent 85aed65e80
commit 1337abd9fe
4 changed files with 22 additions and 5 deletions

View File

@ -2,4 +2,5 @@ CONFIG += ordered
TEMPLATE = subdirs
SUBDIRS = translationhandler \
xmlreport
xmlreport \
xmlreportv1

View File

@ -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<ErrorItem> 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)

View File

@ -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

View File

@ -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