GUITESTS: Move XML V2 tests to own project.
This commit is contained in:
parent
1337abd9fe
commit
c51b66d0b1
|
@ -3,4 +3,5 @@ TEMPLATE = subdirs
|
||||||
|
|
||||||
SUBDIRS = translationhandler \
|
SUBDIRS = translationhandler \
|
||||||
xmlreport \
|
xmlreport \
|
||||||
xmlreportv1
|
xmlreportv1 \
|
||||||
|
xmlreportv2
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Cppcheck - A tool for static C/C++ code analysis
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -21,10 +21,11 @@
|
||||||
#include "testxmlreportv2.h"
|
#include "testxmlreportv2.h"
|
||||||
#include "xmlreportv2.h"
|
#include "xmlreportv2.h"
|
||||||
#include "erroritem.h"
|
#include "erroritem.h"
|
||||||
|
#include "errorlogger.h"
|
||||||
|
|
||||||
void TestXmlReportV2::readXml()
|
void TestXmlReportV2::readXml()
|
||||||
{
|
{
|
||||||
const QString filepath("xmlfiles/xmlreport_v2.xml");
|
const QString filepath("../xmlfiles/xmlreport_v2.xml");
|
||||||
XmlReportV2 report(filepath);
|
XmlReportV2 report(filepath);
|
||||||
QVERIFY(report.Open());
|
QVERIFY(report.Open());
|
||||||
QList<ErrorItem> errors = report.Read();
|
QList<ErrorItem> errors = report.Read();
|
||||||
|
@ -37,7 +38,7 @@ void TestXmlReportV2::readXml()
|
||||||
QCOMPARE(item.files[0], QString("test.cxx"));
|
QCOMPARE(item.files[0], QString("test.cxx"));
|
||||||
QCOMPARE(item.lines[0], (unsigned int)11);
|
QCOMPARE(item.lines[0], (unsigned int)11);
|
||||||
QCOMPARE(item.id, QString("unreadVariable"));
|
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.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"));
|
QCOMPARE(item.message, QString("Variable 'a' is assigned a value that is never used"));
|
||||||
|
|
||||||
|
@ -50,7 +51,9 @@ void TestXmlReportV2::readXml()
|
||||||
QCOMPARE(item2.files[1], QString("test.cxx"));
|
QCOMPARE(item2.files[1], QString("test.cxx"));
|
||||||
QCOMPARE(item2.lines[1], (unsigned int)16);
|
QCOMPARE(item2.lines[1], (unsigned int)16);
|
||||||
QCOMPARE(item2.id, QString("mismatchAllocDealloc"));
|
QCOMPARE(item2.id, QString("mismatchAllocDealloc"));
|
||||||
QCOMPARE(item2.severity, QString("error"));
|
QCOMPARE(GuiSeverity::toString(item2.severity), QString("error"));
|
||||||
QCOMPARE(item2.summary, QString("Mismatching allocation and deallocation: k"));
|
QCOMPARE(item2.summary, QString("Mismatching allocation and deallocation: k"));
|
||||||
QCOMPARE(item2.message, QString("Mismatching allocation and deallocation: k"));
|
QCOMPARE(item2.message, QString("Mismatching allocation and deallocation: k"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QTEST_MAIN(TestXmlReportV2)
|
|
@ -1,6 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Cppcheck - A tool for static C/C++ code analysis
|
* 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
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
|
@ -0,0 +1,13 @@
|
||||||
|
TEMPLATE = app
|
||||||
|
TARGET = test-xmlreportv2
|
||||||
|
DEPENDPATH += .
|
||||||
|
INCLUDEPATH += .
|
||||||
|
OBJECTS_DIR = build
|
||||||
|
MOC_DIR = build
|
||||||
|
|
||||||
|
include(../common.pri)
|
||||||
|
|
||||||
|
# tests
|
||||||
|
SOURCES += testxmlreportv2.cpp
|
||||||
|
|
||||||
|
HEADERS += testxmlreportv2.h
|
Loading…
Reference in New Issue