diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/test/test.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/test/test.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp index 9eb1639..8f6f672 100644 --- a/linden/indra/test/test.cpp +++ b/linden/indra/test/test.cpp | |||
@@ -6,6 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Copyright (c) 2005-2007, Linden Research, Inc. | 7 | * Copyright (c) 2005-2007, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | ||
9 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
10 | * to you under the terms of the GNU General Public License, version 2.0 | 11 | * to you under the terms of the GNU General Public License, version 2.0 |
11 | * ("GPL"), unless you have obtained a separate licensing agreement | 12 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -62,7 +63,8 @@ public: | |||
62 | mVerboseMode(verbose_mode), | 63 | mVerboseMode(verbose_mode), |
63 | mTotalTests(0), | 64 | mTotalTests(0), |
64 | mPassedTests(0), | 65 | mPassedTests(0), |
65 | mFailedTests(0) | 66 | mFailedTests(0), |
67 | mSkippedTests(0) | ||
66 | { | 68 | { |
67 | } | 69 | } |
68 | 70 | ||
@@ -98,6 +100,10 @@ public: | |||
98 | ++mFailedTests; | 100 | ++mFailedTests; |
99 | out << "abnormal termination"; | 101 | out << "abnormal termination"; |
100 | break; | 102 | break; |
103 | case tut::test_result::skip: | ||
104 | ++mSkippedTests; | ||
105 | out << "skipped"; | ||
106 | break; | ||
101 | default: | 107 | default: |
102 | ++mFailedTests; | 108 | ++mFailedTests; |
103 | out << "unknown"; | 109 | out << "unknown"; |
@@ -113,6 +119,12 @@ public: | |||
113 | std::cout << std::endl; | 119 | std::cout << std::endl; |
114 | std::cout << "Total Tests: " << mTotalTests << std::endl; | 120 | std::cout << "Total Tests: " << mTotalTests << std::endl; |
115 | std::cout << "Passed Tests : " << mPassedTests << std::endl; | 121 | std::cout << "Passed Tests : " << mPassedTests << std::endl; |
122 | |||
123 | if (mSkippedTests > 0) | ||
124 | { | ||
125 | std::cout << "Skipped Tests : " << mSkippedTests << std::endl; | ||
126 | } | ||
127 | |||
116 | if(mFailedTests > 0) | 128 | if(mFailedTests > 0) |
117 | { | 129 | { |
118 | std::cout << "*********************************" << std::endl; | 130 | std::cout << "*********************************" << std::endl; |
@@ -128,6 +140,7 @@ protected: | |||
128 | S32 mTotalTests; | 140 | S32 mTotalTests; |
129 | S32 mPassedTests; | 141 | S32 mPassedTests; |
130 | S32 mFailedTests; | 142 | S32 mFailedTests; |
143 | S32 mSkippedTests; | ||
131 | }; | 144 | }; |
132 | 145 | ||
133 | static const apr_getopt_option_t TEST_CL_OPTIONS[] = | 146 | static const apr_getopt_option_t TEST_CL_OPTIONS[] = |
@@ -136,6 +149,7 @@ static const apr_getopt_option_t TEST_CL_OPTIONS[] = | |||
136 | {"list", 'l', 0, "List available test groups."}, | 149 | {"list", 'l', 0, "List available test groups."}, |
137 | {"verbose", 'v', 0, "Verbose output."}, | 150 | {"verbose", 'v', 0, "Verbose output."}, |
138 | {"group", 'g', 1, "Run test group specified by option argument."}, | 151 | {"group", 'g', 1, "Run test group specified by option argument."}, |
152 | {"skip", 's', 1, "Skip test number specified by option argument. Only works when a specific group is being tested"}, | ||
139 | {"wait", 'w', 0, "Wait for input before exit."}, | 153 | {"wait", 'w', 0, "Wait for input before exit."}, |
140 | {0, 0, 0, 0} | 154 | {0, 0, 0, 0} |
141 | }; | 155 | }; |
@@ -165,6 +179,8 @@ void stream_usage(std::ostream& s, const char* app) | |||
165 | s << "\tList all available test groups." << std::endl; | 179 | s << "\tList all available test groups." << std::endl; |
166 | s << " " << app << " --group=uuid" << std::endl; | 180 | s << " " << app << " --group=uuid" << std::endl; |
167 | s << "\tRun the test group 'uuid'." << std::endl; | 181 | s << "\tRun the test group 'uuid'." << std::endl; |
182 | s << " " << app << " --skip=2" << std::endl; | ||
183 | s << "\tSkip test case 2." << std::endl; | ||
168 | } | 184 | } |
169 | 185 | ||
170 | void stream_groups(std::ostream& s, const char* app) | 186 | void stream_groups(std::ostream& s, const char* app) |
@@ -212,6 +228,7 @@ int main(int argc, char **argv) | |||
212 | // values used for controlling application | 228 | // values used for controlling application |
213 | bool verbose_mode = false; | 229 | bool verbose_mode = false; |
214 | bool wait_at_exit = false; | 230 | bool wait_at_exit = false; |
231 | int skip_test_id = 0; | ||
215 | std::string test_group; | 232 | std::string test_group; |
216 | 233 | ||
217 | // values use for options parsing | 234 | // values use for options parsing |
@@ -234,6 +251,9 @@ int main(int argc, char **argv) | |||
234 | case 'g': | 251 | case 'g': |
235 | test_group.assign(opt_arg); | 252 | test_group.assign(opt_arg); |
236 | break; | 253 | break; |
254 | case 's': | ||
255 | skip_test_id = atoi(opt_arg); | ||
256 | break; | ||
237 | case 'h': | 257 | case 'h': |
238 | stream_usage(std::cout, argv[0]); | 258 | stream_usage(std::cout, argv[0]); |
239 | return 0; | 259 | return 0; |
@@ -264,7 +284,7 @@ int main(int argc, char **argv) | |||
264 | } | 284 | } |
265 | else | 285 | else |
266 | { | 286 | { |
267 | tut::runner.get().run_tests(test_group); | 287 | tut::runner.get().run_tests(test_group, skip_test_id); |
268 | } | 288 | } |
269 | 289 | ||
270 | if (wait_at_exit) | 290 | if (wait_at_exit) |