Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
CppUnitLite
TestResult.cpp
Go to the documentation of this file.
1
/* ----------------------------------------------------------------------------
2
3
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
4
* Atlanta, Georgia 30332-0415
5
* All Rights Reserved
6
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8
* See LICENSE for the license information
9
10
* -------------------------------------------------------------------------- */
11
12
13
#include "
TestResult.h
"
14
#include "
Failure.h
"
15
16
#include <stdio.h>
17
18
19
TestResult::TestResult
()
20
: failureCount (0)
21
{
22
}
23
24
25
void
TestResult::testsStarted
()
26
{
27
}
28
29
30
void
TestResult::addFailure
(
const
Failure
& failure)
31
{
32
if
(failure.
lineNumber
< 0)
// allow for no line number
33
fprintf (
stdout
,
"%s%s%s%s\n"
,
34
"Failure: \""
,
35
failure.
message
.c_str (),
36
"\" in "
,
37
failure.
fileName
.c_str ());
38
else
39
fprintf (
stdout
,
"%s%s%ld%s%s%s\n"
,
40
failure.
fileName
.c_str(),
// Format matches Eclipse error flagging
41
":"
,
42
failure.
lineNumber
,
43
": Failure: \""
,
44
failure.
message
.c_str(),
45
"\" "
);
46
47
failureCount
++;
48
}
49
50
51
void
TestResult::testsEnded
()
52
{
53
if
(
failureCount
> 0)
54
fprintf (
stdout
,
"There were %d failures\n"
,
failureCount
);
55
else
56
fprintf (
stdout
,
"There were no test failures\n"
);
57
}
TestResult::testsEnded
virtual void testsEnded()
Definition:
TestResult.cpp:51
Failure::fileName
std::string fileName
Definition:
Failure.h:68
TestResult::TestResult
TestResult()
Definition:
TestResult.cpp:19
Failure::message
std::string message
Definition:
Failure.h:66
Failure::lineNumber
long lineNumber
Definition:
Failure.h:69
TestResult::testsStarted
virtual void testsStarted()
Definition:
TestResult.cpp:25
gtsam.examples.SFMExample_bal.stdout
stdout
Definition:
SFMExample_bal.py:33
TestResult.h
Failure
Definition:
Failure.h:28
TestResult::failureCount
int failureCount
Definition:
TestResult.h:38
Failure.h
TestResult::addFailure
virtual void addFailure(const Failure &failure)
Definition:
TestResult.cpp:30
gtsam
Author(s):
autogenerated on Sat May 8 2021 02:49:22