author | Peter D. Barnes, Jr. <barnes26@llnl.gov> |
Tue, 18 Aug 2015 16:17:36 -0700 | |
changeset 11595 | 18af0e64eee7 |
parent 11538 | 397bd6465dd9 |
child 11610 | d07c72584191 |
permissions | -rw-r--r-- |
150
663120712cd9
fix coding style
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
133
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
3 |
* Copyright (c) 2009 University of Washington |
9
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
*/ |
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
|
2c31ae7c94db
import from yans
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
#include "test.h" |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
20 |
#include "assert.h" |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
21 |
#include "abort.h" |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
22 |
#include "singleton.h" |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
23 |
#include "system-path.h" |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
24 |
#include "log.h" |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9002
diff
changeset
|
25 |
#include <cmath> |
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9002
diff
changeset
|
26 |
#include <cstring> |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
27 |
#include <vector> |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
28 |
#include <list> |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
29 |
#include <map> |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
30 |
|
6204
db1a9442b29f
enable debugger breaks in test-runner and document changes
Craig Dowell <craigdo@ee.washington.edu>
parents:
6157
diff
changeset
|
31 |
|
11356 | 32 |
/** |
33 |
* \file |
|
34 |
* \ingroup testing |
|
35 |
* Implementation of the testing classes and functions |
|
36 |
*/ |
|
37 |
||
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10967
diff
changeset
|
38 |
namespace ns3 { |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
39 |
|
10968
2d29fee2b7b8
[Bug 1551] Redux: NS_LOG_COMPONENT_DEFINE inside or outside of ns3 namespace?
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10967
diff
changeset
|
40 |
NS_LOG_COMPONENT_DEFINE ("Test"); |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
41 |
|
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
42 |
bool |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
43 |
TestDoubleIsEqual (const double x1, const double x2, const double epsilon) |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
44 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
45 |
NS_LOG_FUNCTION (x1 << x2 << epsilon); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
46 |
int exponent; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
47 |
double delta, difference; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
48 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
49 |
// |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
50 |
// Find exponent of largest absolute value |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
51 |
// |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
52 |
{ |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9002
diff
changeset
|
53 |
double max = (std::fabs (x1) > std::fabs (x2)) ? x1 : x2; |
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9002
diff
changeset
|
54 |
(void)std::frexp (max, &exponent); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
55 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
56 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
57 |
// |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
58 |
// Form a neighborhood of size 2 * delta |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
59 |
// |
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9002
diff
changeset
|
60 |
delta = std::ldexp (epsilon, exponent); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
61 |
difference = x1 - x2; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
62 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
63 |
if (difference > delta || difference < -delta) |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
64 |
{ |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
65 |
return false; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
66 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
67 |
return true; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
68 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
69 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
70 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
71 |
* \ingroup testingimpl |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
72 |
* Container for details of a test failure. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
73 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
74 |
struct TestCaseFailure |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
75 |
{ |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
76 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
77 |
* Constructor. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
78 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
79 |
* \param [in] _cond The name of the condition being tested. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
80 |
* \param [in] _actual The actual value returned by the test. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
81 |
* \param [in] _limit The expected value. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
82 |
* \param [in] _message The associated message. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
83 |
* \param [in] _file The soure file. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
84 |
* \param [in] _line The source line. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
85 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
86 |
TestCaseFailure (std::string _cond, std::string _actual, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
87 |
std::string _limit, std::string _message, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
88 |
std::string _file, int32_t _line); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
89 |
std::string cond; /**< The name of the condition being tested. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
90 |
std::string actual; /**< The actual value returned by the test. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
91 |
std::string limit; /**< The expected value. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
92 |
std::string message; /**< The associated message. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
93 |
std::string file; /**< The soure file. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
94 |
int32_t line; /**< The source line. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
95 |
}; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
96 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
97 |
* Output streamer for TestCaseFailure. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
98 |
* |
11538
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
99 |
* \param [in,out] os The output stream. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
100 |
* \param [in] failure The TestCaseFailure to print. |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
101 |
* \returns The stream. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
102 |
*/ |
10555
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
103 |
std::ostream & operator << (std::ostream & os, const TestCaseFailure & failure) |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
104 |
{ |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
105 |
os << " test=\"" << failure.cond |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
106 |
<< "\" actual=\"" << failure.actual |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
107 |
<< "\" limit=\"" << failure.limit |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
108 |
<< "\" in=\"" << failure.file |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
109 |
<< ":" << failure.line |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
110 |
<< "\" " << failure.message; |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
111 |
|
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
112 |
return os; |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
113 |
} |
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
114 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
115 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
116 |
* \ingroup testingimpl |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
117 |
* Container for results from a TestCase. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
118 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
119 |
struct TestCase::Result |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
120 |
{ |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
121 |
/** Constructor. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
122 |
Result (); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
123 |
|
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
124 |
/** Test running time. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
125 |
SystemWallClockMs clock; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
126 |
/** TestCaseFailure records for each child. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
127 |
std::vector<TestCaseFailure> failure; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
128 |
/** \c true if any child TestCases failed. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
129 |
bool childrenFailed; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
130 |
}; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
131 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
132 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
133 |
* \ingroup testingimpl |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
134 |
* Container for all tests. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
135 |
*/ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
136 |
class TestRunnerImpl : public Singleton<TestRunnerImpl> |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
137 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
138 |
public: |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
139 |
/** Constructor. */ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
140 |
TestRunnerImpl (); |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
141 |
|
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
142 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
143 |
* Add a new top-level TestSuite. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
144 |
* \param [in] testSuite The new TestSuite. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
145 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
146 |
void AddTestSuite (TestSuite *testSuite); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
147 |
/** \copydoc TestCase::MustAssertOnFailure() */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
148 |
bool MustAssertOnFailure (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
149 |
/** \copydoc TestCase::MustContinueOnFailure() */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
150 |
bool MustContinueOnFailure (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
151 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
152 |
* Check if this run should update the reference data. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
153 |
* \return \c true if we should update the reference data. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
154 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
155 |
bool MustUpdateData (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
156 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
157 |
* Get the path to the root of the source tree. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
158 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
159 |
* The root directory is defined by the presence of two files: |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
160 |
* "VERSION" and "LICENSE". |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
161 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
162 |
* \returns The path to the root. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
163 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
164 |
std::string GetTopLevelSourceDir (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
165 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
166 |
* Get the path to temporary directory. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
167 |
* \return The temporary directory path. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
168 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
169 |
std::string GetTempDir (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
170 |
/** \copydoc TestRunner::Run() */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
171 |
int Run (int argc, char *argv[]); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
172 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
173 |
private: |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
174 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
175 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
176 |
* Check if this is the root of the source tree. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
177 |
* \param [in] path The path to test. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
178 |
* \returns \c true if \p path is the root. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
179 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
180 |
bool IsTopLevelSourceDir (std::string path) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
181 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
182 |
* Clean up characters not allowed in XML. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
183 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
184 |
* XML files have restrictions on certain characters that may be present in |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
185 |
* data. We need to replace these characters with their alternate |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
186 |
* representation on the way into the XML file. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
187 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
188 |
* Specifically, we make these replacements: |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
189 |
* Raw Source | Replacement |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
190 |
* :--------: | :---------: |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
191 |
* '<' | "<" |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
192 |
* '>' | ">" |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
193 |
* '&' | "&" |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
194 |
* '"' | "&39;" |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
195 |
* '\' | """ |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
196 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
197 |
* \param [in] xml The raw string. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
198 |
* \returns The sanitized string. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
199 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
200 |
std::string ReplaceXmlSpecialCharacters (std::string xml) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
201 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
202 |
* Print the test report. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
203 |
* |
11538
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
204 |
* \param [in] test The TestCase to print. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
205 |
* \param [in,out] os The output stream. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
206 |
* \param [in] xml Generate XML output if \c true. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
207 |
* \param [in] level Indentation level. |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
208 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
209 |
void PrintReport (TestCase *test, std::ostream *os, bool xml, int level); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
210 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
211 |
* Print the list of all requested test suites. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
212 |
* |
11538
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
213 |
* \param [in] begin Iterator to the first TestCase to print. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
214 |
* \param [in] end Iterator to the end of the list. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
215 |
* \param [in] printTestType Preprend the test type label if \c true. |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
216 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
217 |
void PrintTestNameList (std::list<TestCase *>::const_iterator begin, |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
218 |
std::list<TestCase *>::const_iterator end, |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
219 |
bool printTestType) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
220 |
/** Print the list of test types. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
221 |
void PrintTestTypeList (void) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
222 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
223 |
* Print the help text. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
224 |
* \param [in] programName The name of the invoking program. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
225 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
226 |
void PrintHelp (const char *programName) const; |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
227 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
228 |
* Generate the list of tests matching the constraints. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
229 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
230 |
* Test name and type contraints are or'ed. The duration constraint |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
231 |
* is and'ed. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
232 |
* |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
233 |
* \param [in] testName Include a specific test by name. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
234 |
* \param [in] testType Include all tests of give type. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
235 |
* \param [in] maximumTestDuration Restrict to tests shorter than this. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
236 |
* \returns The list of tests matching the filter constraints. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
237 |
*/ |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
238 |
std::list<TestCase *> FilterTests (std::string testName, |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
239 |
enum TestSuite::Type testType, |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
240 |
enum TestCase::TestDuration maximumTestDuration); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
241 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
242 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
243 |
/** Container type for the test. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
244 |
typedef std::vector<TestSuite *> TestSuiteVector; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
245 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
246 |
TestSuiteVector m_suites; //!< The list of tests. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
247 |
std::string m_tempDir; //!< The temporary directory. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
248 |
bool m_verbose; //!< Produce verbose output. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
249 |
bool m_assertOnFailure; //!< \c true if we should assert on failure. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
250 |
bool m_continueOnFailure; //!< \c true if we should continue on failure. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
251 |
bool m_updateData; //!< \c true if we should update reference data. |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
252 |
}; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
253 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
254 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
255 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
256 |
TestCaseFailure::TestCaseFailure (std::string _cond, std::string _actual, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
257 |
std::string _limit, std::string _message, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
258 |
std::string _file, int32_t _line) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
259 |
: cond (_cond), actual (_actual), limit (_limit), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
260 |
message (_message), file (_file), line (_line) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
261 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
262 |
NS_LOG_FUNCTION (this << _cond << _actual << _limit << _message << _file << _line); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
263 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
264 |
TestCase::Result::Result () |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
265 |
: childrenFailed (false) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
266 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
267 |
NS_LOG_FUNCTION (this); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
268 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
269 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
270 |
|
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
271 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
272 |
TestCase::TestCase (std::string name) |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
273 |
: m_parent (0), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
274 |
m_dataDir (""), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
275 |
m_runner (0), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
276 |
m_result (0), |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
277 |
m_name (name), |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
278 |
m_duration (TestCase::QUICK) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
279 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
280 |
NS_LOG_FUNCTION (this << name); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
281 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
282 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
283 |
TestCase::~TestCase () |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
284 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
285 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
286 |
NS_ASSERT (m_runner == 0); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
287 |
m_parent = 0; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
288 |
delete m_result; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
289 |
for (std::vector<TestCase *>::const_iterator i = m_children.begin (); i != m_children.end (); ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
290 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
291 |
delete *i; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
292 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
293 |
m_children.clear (); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
294 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
295 |
|
6775
0783f42a364b
Make test cases not return bool valuesMake all TestSuite instances be static
Mitch Watrous <watrous@u.washington.edu>
parents:
6204
diff
changeset
|
296 |
void |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
297 |
TestCase::AddTestCase (TestCase *testCase, enum TestCase::TestDuration duration) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
298 |
{ |
11595
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
299 |
NS_LOG_FUNCTION (&testCase << duration); |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
300 |
|
11595
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
301 |
// Test names are used to create temporary directories, |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
302 |
// so we test for illegal characters. |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
303 |
// |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
304 |
// Windows: <>:"/\|?* |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
305 |
// http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
306 |
// Mac: : (deprecated, was path separator in Mac OS Classic, pre X) |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
307 |
// Unix: / (and .. may give trouble?) |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
308 |
// |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
309 |
// The Windows list is too restrictive: we like to label |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
310 |
// tests with "val = v1 * v2" or "v1 < 3" or "case: foo --> bar" |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
311 |
// So we allow ':<>*" |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
312 |
|
11595
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
313 |
std::string badchars = "\"/\\|?*"; |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
314 |
// Badchar Class Regex Count of failing test names |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
315 |
// All ":<>\"/\\|?*" 611 |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
316 |
// Allow ':' "<>\"/\\|?*" 128 |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
317 |
// Allow ':<>' "\"/\\|?*" 12 |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
318 |
// Allow ':<>*' "\"/\\|?" 0 |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
319 |
|
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
320 |
std::string::size_type badch = testCase->m_name.find_first_of (badchars); |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
321 |
if (badch != std::string::npos) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
322 |
{ |
11595
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
323 |
/* |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
324 |
To count the bad test names, use NS_LOG_UNCOND instead |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
325 |
of NS_FATAL_ERROR, and the command |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
326 |
$ ./waf --run "test-runner --list" 2>&1 | grep "^Invalid" | wc |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
327 |
*/ |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
328 |
NS_LOG_UNCOND ("Invalid test name: cannot contain any of '" |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
329 |
<< badchars << "': " << testCase->m_name); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
330 |
} |
11595
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
331 |
|
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
332 |
testCase->m_duration = duration; |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
333 |
testCase->m_parent = this; |
18af0e64eee7
Refactor test name character restrictions
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11538
diff
changeset
|
334 |
m_children.push_back (testCase); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
335 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
336 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
337 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
338 |
TestCase::IsFailed (void) const |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
339 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
340 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
341 |
return m_result->childrenFailed || !m_result->failure.empty (); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
342 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
343 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
344 |
void |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
345 |
TestCase::Run (TestRunnerImpl *runner) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
346 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
347 |
NS_LOG_FUNCTION (this << runner); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
348 |
m_result = new Result (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
349 |
m_runner = runner; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
350 |
DoSetup (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
351 |
m_result->clock.Start (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
352 |
for (std::vector<TestCase *>::const_iterator i = m_children.begin (); i != m_children.end (); ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
353 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
354 |
TestCase *test = *i; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
355 |
test->Run (runner); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
356 |
if (IsFailed ()) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
357 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
358 |
goto out; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
359 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
360 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
361 |
DoRun (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
362 |
out: |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
363 |
m_result->clock.End (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
364 |
DoTeardown (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
365 |
m_runner = 0; |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
366 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
367 |
std::string |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
368 |
TestCase::GetName (void) const |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
369 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
370 |
NS_LOG_FUNCTION (this); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
371 |
return m_name; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
372 |
} |
10587
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
373 |
TestCase * |
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
374 |
TestCase::GetParent () const |
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
375 |
{ |
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
376 |
return m_parent; |
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
377 |
} |
804b073ef2fd
Enable tests to get the name of the parent suite.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10555
diff
changeset
|
378 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
379 |
void |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
380 |
TestCase::ReportTestFailure (std::string cond, std::string actual, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
381 |
std::string limit, std::string message, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
382 |
std::string file, int32_t line) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
383 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
384 |
NS_LOG_FUNCTION (this << cond << actual << limit << message << file << line); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
385 |
m_result->failure.push_back (TestCaseFailure (cond, actual, limit, |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
386 |
message, file, line)); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
387 |
// set childrenFailed flag on parents. |
7744
0ee272dab97b
bug 1371: llvm complains about redeclaration as struct
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7426
diff
changeset
|
388 |
TestCase *current = m_parent; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
389 |
while (current != 0) |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
390 |
{ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
391 |
current->m_result->childrenFailed = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
392 |
current = current->m_parent; |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
393 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
394 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
395 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
396 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
397 |
TestCase::MustAssertOnFailure (void) const |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
398 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
399 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
400 |
return m_runner->MustAssertOnFailure (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
401 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
402 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
403 |
TestCase::MustContinueOnFailure (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
404 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
405 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
406 |
return m_runner->MustContinueOnFailure (); |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
407 |
} |
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
408 |
|
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
409 |
std::string |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
410 |
TestCase::CreateDataDirFilename (std::string filename) |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
411 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
412 |
NS_LOG_FUNCTION (this << filename); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
413 |
const TestCase *current = this; |
9781
53881f164b2b
[Coverity] Dereference before null check (REVERSE_INULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9778
diff
changeset
|
414 |
while (current != 0 && current->m_dataDir == "") |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
415 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
416 |
current = current->m_parent; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
417 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
418 |
if (current == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
419 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
420 |
NS_FATAL_ERROR ("No one called SetDataDir prior to calling this function"); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
421 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
422 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
423 |
std::string a = SystemPath::Append (m_runner->GetTopLevelSourceDir (), current->m_dataDir); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
424 |
std::string b = SystemPath::Append (a, filename); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
425 |
return b; |
5481
de01c67af975
pass explicit temp directory to test suites
Craig Dowell <craigdo@ee.washington.edu>
parents:
5458
diff
changeset
|
426 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
427 |
std::string |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
428 |
TestCase::CreateTempDirFilename (std::string filename) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
429 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
430 |
NS_LOG_FUNCTION (this << filename); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
431 |
if (m_runner->MustUpdateData ()) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
432 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
433 |
return CreateDataDirFilename (filename); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
434 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
435 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
436 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
437 |
std::list<std::string> names; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
438 |
const TestCase *current = this; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
439 |
while (current != 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
440 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
441 |
names.push_front (current->m_name); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
442 |
current = current->m_parent; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
443 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
444 |
std::string tempDir = SystemPath::Append (m_runner->GetTempDir (), SystemPath::Join (names.begin (), names.end ())); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
445 |
SystemPath::MakeDirectories (tempDir); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
446 |
return SystemPath::Append (tempDir, filename); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
447 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
448 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
449 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
450 |
TestCase::IsStatusFailure (void) const |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
451 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
452 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
453 |
return !IsStatusSuccess (); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
454 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
455 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
456 |
TestCase::IsStatusSuccess (void) const |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
457 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
458 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
459 |
return m_result->failure.empty (); |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
460 |
} |
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
461 |
|
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
462 |
void |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
463 |
TestCase::SetDataDir (std::string directory) |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
464 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
465 |
NS_LOG_FUNCTION (this << directory); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
466 |
m_dataDir = directory; |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
467 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
468 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
469 |
void |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
470 |
TestCase::DoSetup (void) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
471 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
472 |
NS_LOG_FUNCTION (this); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
473 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
474 |
void |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
475 |
TestCase::DoTeardown (void) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
476 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
477 |
NS_LOG_FUNCTION (this); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
478 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
479 |
|
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
480 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
481 |
TestSuite::TestSuite (std::string name, TestSuite::Type type) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
482 |
: TestCase (name), |
5324
0ba73cdd2a43
Refalgamize test framework to allow multiple test failures
Craig Dowell <craigdo@ee.washington.edu>
parents:
5300
diff
changeset
|
483 |
m_type (type) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
484 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
485 |
NS_LOG_FUNCTION (this << name << type); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
486 |
TestRunnerImpl::Get ()->AddTestSuite (this); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
487 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
488 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
489 |
TestSuite::Type |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
490 |
TestSuite::GetTestType (void) |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
491 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
492 |
NS_LOG_FUNCTION (this); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
493 |
return m_type; |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
494 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
495 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
496 |
void |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
497 |
TestSuite::DoRun (void) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
498 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
499 |
NS_LOG_FUNCTION (this); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
500 |
} |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
501 |
|
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
502 |
TestRunnerImpl::TestRunnerImpl () |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
503 |
: m_tempDir (""), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
504 |
m_assertOnFailure (false), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
505 |
m_continueOnFailure (true), |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
506 |
m_updateData (false) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
507 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
508 |
NS_LOG_FUNCTION (this); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
509 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
510 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
511 |
void |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
512 |
TestRunnerImpl::AddTestSuite (TestSuite *testSuite) |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
513 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
514 |
NS_LOG_FUNCTION (this << testSuite); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
515 |
m_suites.push_back (testSuite); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
516 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
517 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
518 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
519 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
520 |
TestRunnerImpl::MustAssertOnFailure (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
521 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
522 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
523 |
return m_assertOnFailure; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
524 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
525 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
526 |
TestRunnerImpl::MustContinueOnFailure (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
527 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
528 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
529 |
return m_continueOnFailure; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
530 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
531 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
532 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
533 |
TestRunnerImpl::MustUpdateData (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
534 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
535 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
536 |
return m_updateData; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
537 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
538 |
std::string |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
539 |
TestRunnerImpl::GetTempDir (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
540 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
541 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
542 |
return m_tempDir; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
543 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
544 |
bool |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
545 |
TestRunnerImpl::IsTopLevelSourceDir (std::string path) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
546 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
547 |
NS_LOG_FUNCTION (this << path); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
548 |
bool haveVersion = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
549 |
bool haveLicense = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
550 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
551 |
// |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
552 |
// If there's a file named VERSION and a file named LICENSE in this |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
553 |
// directory, we assume it's our top level source directory. |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
554 |
// |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
555 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
556 |
std::list<std::string> files = SystemPath::ReadFiles (path); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
557 |
for (std::list<std::string>::const_iterator i = files.begin (); i != files.end (); ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
558 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
559 |
if (*i == "VERSION") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
560 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
561 |
haveVersion = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
562 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
563 |
else if (*i == "LICENSE") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
564 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
565 |
haveLicense = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
566 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
567 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
568 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
569 |
return haveVersion && haveLicense; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
570 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
571 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
572 |
std::string |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
573 |
TestRunnerImpl::GetTopLevelSourceDir (void) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
574 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
575 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
576 |
std::string self = SystemPath::FindSelfDirectory (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
577 |
std::list<std::string> elements = SystemPath::Split (self); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
578 |
while (!elements.empty ()) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
579 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
580 |
std::string path = SystemPath::Join (elements.begin (), elements.end ()); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
581 |
if (IsTopLevelSourceDir (path)) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
582 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
583 |
return path; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
584 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
585 |
elements.pop_back (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
586 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
587 |
NS_FATAL_ERROR ("Could not find source directory from self=" << self); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
588 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
589 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
590 |
// |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
591 |
// XML files have restrictions on certain characters that may be present in |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
592 |
// data. We need to replace these characters with their alternate |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
593 |
// representation on the way into the XML file. |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
594 |
// |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
595 |
std::string |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
596 |
TestRunnerImpl::ReplaceXmlSpecialCharacters (std::string xml) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
597 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
598 |
NS_LOG_FUNCTION (this << xml); |
9876
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
599 |
typedef std::map <char, std::string> specials_map; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
600 |
specials_map specials; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
601 |
specials['<'] = "<"; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
602 |
specials['>'] = ">"; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
603 |
specials['&'] = "&"; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
604 |
specials['"'] = "'"; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
605 |
specials['\''] = """; |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
606 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
607 |
std::string result; |
9876
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
608 |
std::size_t length = xml.length (); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
609 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
610 |
for (size_t i = 0; i < length; ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
611 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
612 |
char character = xml[i]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
613 |
|
9876
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
614 |
specials_map::const_iterator it = specials.find (character); |
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
615 |
|
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
616 |
if (it == specials.end ()) |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
617 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
618 |
result.push_back (character); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
619 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
620 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
621 |
{ |
9876
c84d748a959f
[Coverity] Out-of-bounds read (OVERRUN)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9784
diff
changeset
|
622 |
result += it->second; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
623 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
624 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
625 |
return result; |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
626 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
627 |
|
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
628 |
/** Helper to indent output a specified number of steps. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
629 |
struct Indent |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
630 |
{ |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
631 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
632 |
* Constructor. |
11538
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
633 |
* \param [in] level The number of steps. A step is " ". |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
634 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
635 |
Indent (int level); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
636 |
/** The number of steps. */ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
637 |
int level; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
638 |
}; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
639 |
Indent::Indent (int _level) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
640 |
: level (_level) |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
641 |
{ |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
642 |
NS_LOG_FUNCTION (this << _level); |
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
643 |
} |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
644 |
/** |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
645 |
* Output streamer for Indent. |
11538
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
646 |
* \param [in,out] os The output stream. |
397bd6465dd9
[Doxygen] Label arguments as in,out. Sentence capitalization.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11531
diff
changeset
|
647 |
* \param [in] val The Indent object. |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
648 |
* \returns The stream. |
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
649 |
*/ |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
650 |
std::ostream &operator << (std::ostream &os, const Indent &val) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
651 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
652 |
for (int i = 0; i < val.level; i++) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
653 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
654 |
os << " "; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
655 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
656 |
return os; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
657 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
658 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
659 |
void |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
660 |
TestRunnerImpl::PrintReport (TestCase *test, std::ostream *os, bool xml, int level) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
661 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
662 |
NS_LOG_FUNCTION (this << test << os << xml << level); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
663 |
if (test->m_result == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
664 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
665 |
// Do not print reports for tests that were not run. |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
666 |
return; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
667 |
} |
9002
c945e549e7ca
test-runner reports times in seconds, not ms
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7744
diff
changeset
|
668 |
// Report times in seconds, from ms timer |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
669 |
const double MS_PER_SEC = 1000.; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
670 |
double real = test->m_result->clock.GetElapsedReal () / MS_PER_SEC; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
671 |
double user = test->m_result->clock.GetElapsedUser () / MS_PER_SEC; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
672 |
double system = test->m_result->clock.GetElapsedSystem () / MS_PER_SEC; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
673 |
|
9877
7511dc1f8ae8
[Coverity] Not restoring ostream format (STREAM_FORMAT_STATE)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9876
diff
changeset
|
674 |
std::streamsize oldPrecision = (*os).precision (3); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
675 |
*os << std::fixed; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
676 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
677 |
std::string statusString = test->IsFailed ()?"FAIL":"PASS"; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
678 |
if (xml) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
679 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
680 |
*os << Indent (level) << "<Test>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
681 |
*os << Indent (level+1) << "<Name>" << ReplaceXmlSpecialCharacters (test->m_name) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
682 |
<< "</Name>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
683 |
*os << Indent (level+1) << "<Result>" << statusString << "</Result>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
684 |
*os << Indent (level+1) << "<Time real=\"" << real << "\" user=\"" << user |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
685 |
<< "\" system=\"" << system << "\"/>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
686 |
for (uint32_t i = 0; i < test->m_result->failure.size (); i++) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
687 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
688 |
TestCaseFailure failure = test->m_result->failure[i]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
689 |
*os << Indent (level+2) << "<FailureDetails>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
690 |
<< Indent (level+3) << "<Condition>" |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
691 |
<< ReplaceXmlSpecialCharacters (failure.cond) << "</Condition>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
692 |
<< Indent (level+3) << "<Actual>" |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
693 |
<< ReplaceXmlSpecialCharacters (failure.actual) << "</Actual>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
694 |
<< Indent (level+3) << "<Limit>" |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
695 |
<< ReplaceXmlSpecialCharacters (failure.limit) << "</Limit>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
696 |
<< Indent (level+3) << "<Message>" |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
697 |
<< ReplaceXmlSpecialCharacters (failure.message) << "</Message>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
698 |
<< Indent (level+3) << "<File>" |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
699 |
<< ReplaceXmlSpecialCharacters (failure.file) << "</File>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
700 |
<< Indent (level+3) << "<Line>" << failure.line << "</Line>" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
701 |
<< Indent (level+2) << "</FailureDetails>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
702 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
703 |
for (uint32_t i = 0; i < test->m_children.size (); i++) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
704 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
705 |
TestCase *child = test->m_children[i]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
706 |
PrintReport (child, os, xml, level + 1); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
707 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
708 |
*os << Indent (level) << "</Test>" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
709 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
710 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
711 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
712 |
*os << Indent (level) << statusString << " " << test->GetName () |
9002
c945e549e7ca
test-runner reports times in seconds, not ms
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
7744
diff
changeset
|
713 |
<< " " << real << " s" << std::endl; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
714 |
if (m_verbose) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
715 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
716 |
for (uint32_t i = 0; i < test->m_result->failure.size (); i++) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
717 |
{ |
10555
5dddf260e22f
Test failure should show condition, actual value, *and* expected (limit) value.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10411
diff
changeset
|
718 |
*os << Indent (level) << test->m_result->failure[i] << std::endl; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
719 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
720 |
for (uint32_t i = 0; i < test->m_children.size (); i++) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
721 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
722 |
TestCase *child = test->m_children[i]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
723 |
PrintReport (child, os, xml, level + 1); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
724 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
725 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
726 |
} |
9778
45a56374ae2b
[Coverity] Not restoring ostream format (STREAM_FORMAT_STATE)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9275
diff
changeset
|
727 |
|
9877
7511dc1f8ae8
[Coverity] Not restoring ostream format (STREAM_FORMAT_STATE)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9876
diff
changeset
|
728 |
(*os).unsetf(std::ios_base::floatfield); |
7511dc1f8ae8
[Coverity] Not restoring ostream format (STREAM_FORMAT_STATE)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9876
diff
changeset
|
729 |
(*os).precision (oldPrecision); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
730 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
731 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
732 |
void |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
733 |
TestRunnerImpl::PrintHelp (const char *program_name) const |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
734 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
735 |
NS_LOG_FUNCTION (this << program_name); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
736 |
std::cout << "Usage: " << program_name << " [OPTIONS]" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
737 |
<< std::endl |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
738 |
<< "Options: " << std::endl |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
739 |
<< " --help : print these options" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
740 |
<< " --print-test-name-list : print the list of names of tests available" << std::endl |
7426
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
741 |
<< " --list : an alias for --print-test-name-list" << std::endl |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
742 |
<< " --print-test-types : print the type of tests along with their names" << std::endl |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
743 |
<< " --print-test-type-list : print the list of types of tests available" << std::endl |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
744 |
<< " --print-temp-dir : print name of temporary directory before running " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
745 |
<< " the tests" << std::endl |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
746 |
<< " --test-type=TYPE : process only tests of type TYPE" << std::endl |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
747 |
<< " --test-name=NAME : process only test whose name matches NAME" << std::endl |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
748 |
<< " --suite=NAME : an alias (here for compatibility reasons only) " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
749 |
<< " for --test-name=NAME" << std::endl |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
750 |
<< " --assert-on-failure : when a test fails, crash immediately (useful" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
751 |
<< " when running under a debugger" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
752 |
<< " --stop-on-failure : when a test fails, stop immediately" << std::endl |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
753 |
<< " --fullness=FULLNESS : choose the duration of tests to run: QUICK, " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
754 |
<< " EXTENSIVE, or TAKES_FOREVER, where EXTENSIVE " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
755 |
<< " includes QUICK and TAKES_FOREVER includes " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
756 |
<< " QUICK and EXTENSIVE (only QUICK tests are " << std::endl |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
757 |
<< " run by default)" << std::endl |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
758 |
<< " --verbose : print details of test execution" << std::endl |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
759 |
<< " --xml : format test run output as xml" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
760 |
<< " --tempdir=DIR : set temp dir for tests to store output files" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
761 |
<< " --datadir=DIR : set data dir for tests to read reference files" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
762 |
<< " --out=FILE : send test result to FILE instead of standard " |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
763 |
<< "output" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
764 |
<< " --append=FILE : append test result to FILE instead of standard " |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
765 |
<< "output" << std::endl |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
766 |
; |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
767 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
768 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
769 |
void |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
770 |
TestRunnerImpl::PrintTestNameList (std::list<TestCase *>::const_iterator begin, |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
771 |
std::list<TestCase *>::const_iterator end, |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
772 |
bool printTestType) const |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
773 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
774 |
NS_LOG_FUNCTION (this << &begin << &end << printTestType); |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
775 |
std::map<TestSuite::Type, std::string> label; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
776 |
|
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
777 |
label[TestSuite::ALL] = "all "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
778 |
label[TestSuite::BVT] = "bvt "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
779 |
label[TestSuite::UNIT] = "unit "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
780 |
label[TestSuite::SYSTEM] = "system "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
781 |
label[TestSuite::EXAMPLE] = "example "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
782 |
label[TestSuite::PERFORMANCE] = "performance "; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
783 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
784 |
for (std::list<TestCase *>::const_iterator i = begin; i != end; ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
785 |
{ |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
786 |
TestSuite * test= dynamic_cast<TestSuite *>(*i); |
9784
740a983ed25b
[Coverity] Unchecked dynamic_cast (FORWARD_NULL)
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9781
diff
changeset
|
787 |
NS_ASSERT (test != 0); |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
788 |
if (printTestType) |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
789 |
{ |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
790 |
std::cout << label[test->GetTestType ()]; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
791 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
792 |
std::cout << test->GetName () << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
793 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
794 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
795 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
796 |
void |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
797 |
TestRunnerImpl::PrintTestTypeList (void) const |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
798 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
799 |
NS_LOG_FUNCTION (this); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
800 |
std::cout << " bvt: Build Verification Tests (to see if build completed successfully)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
801 |
std::cout << " core: Run all TestSuite-based tests (exclude examples)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
802 |
std::cout << " example: Examples (to see if example programs run successfully)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
803 |
std::cout << " performance: Performance Tests (check to see if the system is as fast as expected)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
804 |
std::cout << " system: System Tests (spans modules to check integration of modules)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
805 |
std::cout << " unit: Unit Tests (within modules to check basic functionality)" << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
806 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
807 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
808 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
809 |
std::list<TestCase *> |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
810 |
TestRunnerImpl::FilterTests (std::string testName, |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
811 |
enum TestSuite::Type testType, |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
812 |
enum TestCase::TestDuration maximumTestDuration) |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
813 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
814 |
NS_LOG_FUNCTION (this << testName << testType); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
815 |
std::list<TestCase *> tests; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
816 |
for (uint32_t i = 0; i < m_suites.size (); ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
817 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
818 |
TestSuite *test = m_suites[i]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
819 |
if (testType != TestSuite::ALL && test->GetTestType () != testType) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
820 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
821 |
// skip test |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
822 |
continue; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
823 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
824 |
if (testName != "" && test->GetName () != testName) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
825 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
826 |
// skip test |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
827 |
continue; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
828 |
} |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
829 |
|
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
830 |
// Remove any test cases that should be skipped. |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
831 |
std::vector<TestCase *>::iterator j; |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
832 |
for (j = test->m_children.begin (); j != test->m_children.end ();) |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
833 |
{ |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
834 |
TestCase *testCase = *j; |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
835 |
|
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
836 |
// If this test case takes longer than the maximum test |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
837 |
// duration that should be run, then don't run it. |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
838 |
if (testCase->m_duration > maximumTestDuration) |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
839 |
{ |
9275
3aea6c14a1f9
Bug 1563 - reduce valgrind test scope
Mitch Watrous <watrous@u.washington.edu>
parents:
9266
diff
changeset
|
840 |
// Free this test case's memory. |
3aea6c14a1f9
Bug 1563 - reduce valgrind test scope
Mitch Watrous <watrous@u.washington.edu>
parents:
9266
diff
changeset
|
841 |
delete *j; |
3aea6c14a1f9
Bug 1563 - reduce valgrind test scope
Mitch Watrous <watrous@u.washington.edu>
parents:
9266
diff
changeset
|
842 |
|
3aea6c14a1f9
Bug 1563 - reduce valgrind test scope
Mitch Watrous <watrous@u.washington.edu>
parents:
9266
diff
changeset
|
843 |
// Remove this test case from the test suite. |
9879
407d9c42419b
[Coverity] "erase" invalidates iterator
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
9877
diff
changeset
|
844 |
j = test->m_children.erase (j); |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
845 |
} |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
846 |
else |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
847 |
{ |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
848 |
// Only advance through the vector elements if this test |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
849 |
// case wasn't deleted. |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
850 |
++j; |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
851 |
} |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
852 |
} |
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
853 |
|
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
854 |
// Add this test suite. |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
855 |
tests.push_back (test); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
856 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
857 |
return tests; |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
858 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
859 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
860 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
861 |
int |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
862 |
TestRunnerImpl::Run (int argc, char *argv[]) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
863 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
864 |
NS_LOG_FUNCTION (this << argc << argv); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
865 |
std::string testName = ""; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
866 |
std::string testTypeString = ""; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
867 |
std::string out = ""; |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
868 |
std::string fullness = ""; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
869 |
bool xml = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
870 |
bool append = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
871 |
bool printTempDir = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
872 |
bool printTestTypeList = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
873 |
bool printTestNameList = false; |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
874 |
bool printTestTypeAndName = false; |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
875 |
enum TestCase::TestDuration maximumTestDuration = TestCase::QUICK; |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
876 |
char *progname = argv[0]; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
877 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
878 |
argv++; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
879 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
880 |
while (*argv != 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
881 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
882 |
char *arg = *argv; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
883 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
884 |
if (strcmp(arg, "--assert-on-failure") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
885 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
886 |
m_assertOnFailure = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
887 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
888 |
else if (strcmp (arg, "--stop-on-failure") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
889 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
890 |
m_continueOnFailure = false; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
891 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
892 |
else if (strcmp (arg, "--verbose") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
893 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
894 |
m_verbose = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
895 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
896 |
else if (strcmp (arg, "--print-temp-dir") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
897 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
898 |
printTempDir = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
899 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
900 |
else if (strcmp (arg, "--update-data") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
901 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
902 |
m_updateData = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
903 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
904 |
else if (strcmp (arg, "--help") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
905 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
906 |
PrintHelp (progname); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
907 |
return 0; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
908 |
} |
7426
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
909 |
else if (strcmp (arg, "--print-test-name-list") == 0 || |
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
910 |
strcmp(arg, "--list") == 0) |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
911 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
912 |
printTestNameList = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
913 |
} |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
914 |
else if (strcmp (arg, "--print-test-types") == 0) |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
915 |
{ |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
916 |
printTestTypeAndName = true; |
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
917 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
918 |
else if (strcmp (arg, "--print-test-type-list") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
919 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
920 |
printTestTypeList = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
921 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
922 |
else if (strcmp(arg, "--append") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
923 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
924 |
append = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
925 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
926 |
else if (strcmp(arg, "--xml") == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
927 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
928 |
xml = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
929 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
930 |
else if (strncmp(arg, "--test-type=", strlen("--test-type=")) == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
931 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
932 |
testTypeString = arg + strlen("--test-type="); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
933 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
934 |
else if (strncmp(arg, "--test-name=", strlen("--test-name=")) == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
935 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
936 |
testName = arg + strlen("--test-name="); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
937 |
} |
7426
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
938 |
else if (strncmp(arg, "--suite=", strlen("--suite=")) == 0) |
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
939 |
{ |
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
940 |
testName = arg + strlen("--suite="); |
d2d7a32fd452
add backward-compatibility aliases for test-runner command-line arguments
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7379
diff
changeset
|
941 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
942 |
else if (strncmp(arg, "--tempdir=", strlen("--tempdir=")) == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
943 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
944 |
m_tempDir = arg + strlen("--tempdir="); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
945 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
946 |
else if (strncmp(arg, "--out=", strlen("--out=")) == 0) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
947 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
948 |
out = arg + strlen("--out="); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
949 |
} |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
950 |
else if (strncmp(arg, "--fullness=", strlen("--fullness=")) == 0) |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
951 |
{ |
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
952 |
fullness = arg + strlen("--fullness="); |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
953 |
|
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
954 |
// Set the maximum test length allowed. |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
955 |
if (fullness == "EXTENSIVE") |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
956 |
{ |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
957 |
maximumTestDuration = TestCase::EXTENSIVE; |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
958 |
} |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
959 |
else if (fullness == "TAKES_FOREVER") |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
960 |
{ |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
961 |
maximumTestDuration = TestCase::TAKES_FOREVER; |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
962 |
} |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
963 |
else |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
964 |
{ |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
965 |
maximumTestDuration = TestCase::QUICK; |
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
966 |
} |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
967 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
968 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
969 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
970 |
// un-recognized command-line argument |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
971 |
PrintHelp (progname); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
972 |
return 0; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
973 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
974 |
argv++; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
975 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
976 |
enum TestSuite::Type testType; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
977 |
if (testTypeString == "") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
978 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
979 |
testType = TestSuite::ALL; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
980 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
981 |
else if (testTypeString == "bvt") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
982 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
983 |
testType = TestSuite::BVT; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
984 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
985 |
else if (testTypeString == "core") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
986 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
987 |
testType = TestSuite::ALL; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
988 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
989 |
else if (testTypeString == "example") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
990 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
991 |
testType = TestSuite::EXAMPLE; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
992 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
993 |
else if (testTypeString == "unit") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
994 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
995 |
testType = TestSuite::UNIT; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
996 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
997 |
else if (testTypeString == "system") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
998 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
999 |
testType = TestSuite::SYSTEM; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1000 |
} |
9072
7bfaded450be
Bug 1284 - ./test.py performance tests do not exist
Mitch Watrous <watrous@u.washington.edu>
parents:
9063
diff
changeset
|
1001 |
else if (testTypeString == "performance") |
7bfaded450be
Bug 1284 - ./test.py performance tests do not exist
Mitch Watrous <watrous@u.washington.edu>
parents:
9063
diff
changeset
|
1002 |
{ |
7bfaded450be
Bug 1284 - ./test.py performance tests do not exist
Mitch Watrous <watrous@u.washington.edu>
parents:
9063
diff
changeset
|
1003 |
testType = TestSuite::PERFORMANCE; |
7bfaded450be
Bug 1284 - ./test.py performance tests do not exist
Mitch Watrous <watrous@u.washington.edu>
parents:
9063
diff
changeset
|
1004 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1005 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1006 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1007 |
std::cout << "Invalid test type specified: " << testTypeString << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1008 |
PrintTestTypeList (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1009 |
return 1; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1010 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1011 |
|
9265
0455e96a3cca
Allow three speeds of test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9256
diff
changeset
|
1012 |
std::list<TestCase *> tests = FilterTests (testName, testType, maximumTestDuration); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1013 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1014 |
if (m_tempDir == "") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1015 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1016 |
m_tempDir = SystemPath::MakeTemporaryDirectoryName (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1017 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1018 |
if (printTempDir) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1019 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1020 |
std::cout << m_tempDir << std::endl; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1021 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1022 |
if (printTestNameList) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1023 |
{ |
9075
f8fe606acbda
Bug 1493 - test.py --list should show the test type
Mitch Watrous <watrous@u.washington.edu>
parents:
9072
diff
changeset
|
1024 |
PrintTestNameList (tests.begin (), tests.end (), printTestTypeAndName); |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1025 |
return 0; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1026 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1027 |
if (printTestTypeList) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1028 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1029 |
PrintTestTypeList (); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1030 |
return 0; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1031 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1032 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1033 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1034 |
std::ostream *os; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1035 |
if (out != "") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1036 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1037 |
std::ofstream *ofs; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1038 |
ofs = new std::ofstream(); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1039 |
std::ios_base::openmode mode = std::ios_base::out; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1040 |
if (append) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1041 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1042 |
mode |= std::ios_base::app; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1043 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1044 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1045 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1046 |
mode |= std::ios_base::trunc; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1047 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1048 |
ofs->open (out.c_str (), mode); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1049 |
os = ofs; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1050 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1051 |
else |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1052 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1053 |
os = &std::cout; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1054 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1055 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1056 |
// let's run our tests now. |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1057 |
bool failed = false; |
11123
893aa21e059c
[Tutorial] clarify that there is no mytest, and output an error if no test is to be run.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11019
diff
changeset
|
1058 |
if (tests.size () == 0) |
893aa21e059c
[Tutorial] clarify that there is no mytest, and output an error if no test is to be run.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11019
diff
changeset
|
1059 |
{ |
893aa21e059c
[Tutorial] clarify that there is no mytest, and output an error if no test is to be run.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11019
diff
changeset
|
1060 |
std::cerr << "Error: no tests match the requested string" << std::endl; |
893aa21e059c
[Tutorial] clarify that there is no mytest, and output an error if no test is to be run.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11019
diff
changeset
|
1061 |
return 1; |
893aa21e059c
[Tutorial] clarify that there is no mytest, and output an error if no test is to be run.
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11019
diff
changeset
|
1062 |
} |
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1063 |
for (std::list<TestCase *>::const_iterator i = tests.begin (); i != tests.end (); ++i) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1064 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1065 |
TestCase *test = *i; |
9256
68d3f772c696
Allow very slow test cases to be skipped
Mitch Watrous <watrous@u.washington.edu>
parents:
9193
diff
changeset
|
1066 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1067 |
test->Run (this); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1068 |
PrintReport (test, os, xml, 0); |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1069 |
if (test->IsFailed ()) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1070 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1071 |
failed = true; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1072 |
if (!m_continueOnFailure) |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1073 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1074 |
return 1; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1075 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1076 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1077 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1078 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1079 |
if (out != "") |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1080 |
{ |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1081 |
delete os; |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1082 |
} |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1083 |
|
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1084 |
return failed?1:0; |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
1085 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
1086 |
|
7379
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1087 |
int |
ff0d074f885a
add support for --update-data to test.py, move test runner code to library for modular build, add support for hierarchical tests beyond the previous two-level hierarchy.
Mathieu Lacage <mathieu.lacage@gmail.com>
parents:
7169
diff
changeset
|
1088 |
TestRunner::Run (int argc, char *argv[]) |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
1089 |
{ |
9134
7a750f032acd
Clean up function logging of core module.
Maja Grubišić <maja.grubisic@live.com>
parents:
9075
diff
changeset
|
1090 |
NS_LOG_FUNCTION (argc << argv); |
11531
5d6b3f94ebf3
[Doxygen] Remaining in core
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
11528
diff
changeset
|
1091 |
return TestRunnerImpl::Get ()->Run (argc, argv); |
4772
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
1092 |
} |
7b6ae6bf0055
add test and validation framework
Craig Dowell <craigdo@ee.washington.edu>
parents:
4531
diff
changeset
|
1093 |
|
5342
3c6109eec550
bug 675: kill old test framework
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
5324
diff
changeset
|
1094 |
} // namespace ns3 |