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 
20  : failureCount (0)
21 {
22 }
23 
24 
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 
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 }
virtual void testsEnded()
Definition: TestResult.cpp:51
std::string fileName
Definition: Failure.h:68
std::string message
Definition: Failure.h:66
long lineNumber
Definition: Failure.h:69
virtual void testsStarted()
Definition: TestResult.cpp:25
int failureCount
Definition: TestResult.h:38
virtual void addFailure(const Failure &failure)
Definition: TestResult.cpp:30


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:39:17