LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
TestCasesHandler.h
Go to the documentation of this file.
1
// Copyright 2002-2013 CEA LIST
2
// SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
3
//
4
// SPDX-License-Identifier: MIT
5
6
/***************************************************************************
7
* Copyright (C) 2004 by Benoit Mathieu *
8
* mathieub@zoe.cea.fr *
9
* *
10
***************************************************************************/
11
12
#ifndef LIMA_TGV_TESTCASESHANDLER_H
13
#define LIMA_TGV_TESTCASESHANDLER_H
14
15
#include "
TestCase.h
"
16
#include "
TestCaseProcessor.hpp
"
17
18
#include <QtXml/QXmlDefaultHandler>
19
20
namespace
Lima
21
{
22
namespace
Common
23
{
24
namespace
TGV
25
{
26
class
LIMA_TGV_EXPORT
TestCasesHandler
:
public
QXmlDefaultHandler
27
{
28
29
public
:
30
TestCasesHandler
(
TestCaseProcessor
& processor);
31
virtual
~ TestCasesHandler();
32
33
// -----------------------------------------------------------------------
34
// Implementations of the SAX DocumentHandler interface
35
// -----------------------------------------------------------------------
36
bool
endElement(
const
QString & namespaceURI,
const
QString & name,
const
QString & qName)
override
;
37
38
bool
characters(
const
QString& chars)
override
;
39
40
bool
startElement(
const
QString & namespaceURI,
const
QString & name,
const
QString & qName,
const
QXmlAttributes & attributes)
override
;
41
42
bool
startDocument()
override
;
43
44
inline
bool
hasFatalError
()
const
{
return
m_hasFatalError; }
45
46
47
struct
TestReport
{
48
uint64_t
success
;
49
uint64_t
failed
;
50
uint64_t
conditional
;
51
uint64_t
nbtests
;
52
TestReport
() : success(0),failed(0),conditional(0),nbtests(0) {};
53
};
54
55
std::map<std::string,TestReport>
m_reportByType
;
56
57
private
:
58
std::string attributeValue(
const
QString& attr,
const
QXmlAttributes& attrs)
const
;
59
60
// Liste des parametres possibles et obligatoires dans un TestCase
61
// pour lp: (text, language, pipeline?...)
62
// std::map<std::string,bool> m_simpleValParamTestCaseKeys;
63
// std::map<std::string,bool> m_multiValParamTestCaseKeys;
64
65
TestCaseProcessor
& m_processor;
66
TestCase
currentTestCase;
67
68
std::string getName(
const
QString& localName,
69
const
QString& qName);
70
71
bool
m_inText;
72
bool
m_inExpl;
73
bool
m_inParam;
74
bool
m_inList;
75
bool
m_inMap;
76
std::string m_listKey;
77
std::string m_mapKey;
78
79
bool
m_hasFatalError;
80
};
81
82
// This utility function return a user-defined exit code (64) if a "bloquant"
83
// test failed.
84
LIMA_TGV_EXPORT
int
exitCode
(
TestCasesHandler
const
& tch);
85
86
}
// TGV
87
}
// Common
88
}
// Lima
89
90
91
#endif
LIMA_TGV_EXPORT
#define LIMA_TGV_EXPORT
Definition
LinguisticProcessingCommon.h:86
TestCaseProcessor.hpp
TestCase.h
Lima::Common::TGV::TestCaseProcessor
Definition
TestCaseProcessor.hpp:33
Lima::Common::TGV::TestCasesHandler
Definition
TestCasesHandler.h:27
Lima::Common::TGV::TestCasesHandler::hasFatalError
bool hasFatalError() const
Definition
TestCasesHandler.h:44
Lima::Common::TGV::TestCasesHandler::m_reportByType
std::map< std::string, TestReport > m_reportByType
Definition
TestCasesHandler.h:55
Lima::Common::TGV::exitCode
int exitCode(TestCasesHandler const &tch)
Definition
TestCasesHandler.cpp:243
Lima
NAUTITIA.
Definition
AmosePluginsManager.h:15
Lima::Common::TGV::TestCase
Definition
TestCase.h:37
Lima::Common::TGV::TestCasesHandler::TestReport
Definition
TestCasesHandler.h:47
Lima::Common::TGV::TestCasesHandler::TestReport::failed
uint64_t failed
Definition
TestCasesHandler.h:49
Lima::Common::TGV::TestCasesHandler::TestReport::nbtests
uint64_t nbtests
Definition
TestCasesHandler.h:51
Lima::Common::TGV::TestCasesHandler::TestReport::conditional
uint64_t conditional
Definition
TestCasesHandler.h:50
Lima::Common::TGV::TestCasesHandler::TestReport::success
uint64_t success
Definition
TestCasesHandler.h:48
Lima::Common::TGV::TestCasesHandler::TestReport::TestReport
TestReport()
Definition
TestCasesHandler.h:52
lima_linguisticprocessing
src
linguisticProcessing
common
tgv
TestCasesHandler.h
Generated by
1.9.8