diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/test/test.cpp | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/test/test.cpp')
-rw-r--r-- | linden/indra/test/test.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/linden/indra/test/test.cpp b/linden/indra/test/test.cpp index 10a2088..ba81c6e 100644 --- a/linden/indra/test/test.cpp +++ b/linden/indra/test/test.cpp | |||
@@ -19,7 +19,8 @@ | |||
19 | * There are special exceptions to the terms and conditions of the GPL as | 19 | * There are special exceptions to the terms and conditions of the GPL as |
20 | * it is applied to this Source Code. View the full text of the exception | 20 | * it is applied to this Source Code. View the full text of the exception |
21 | * in the file doc/FLOSS-exception.txt in this software distribution, or | 21 | * in the file doc/FLOSS-exception.txt in this software distribution, or |
22 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | 22 | * online at |
23 | * http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
23 | * | 24 | * |
24 | * By copying, modifying or distributing this software, you acknowledge | 25 | * By copying, modifying or distributing this software, you acknowledge |
25 | * that you have read and understood your obligations described above, | 26 | * that you have read and understood your obligations described above, |
@@ -53,9 +54,10 @@ | |||
53 | # include "ctype_workaround.h" | 54 | # include "ctype_workaround.h" |
54 | #endif | 55 | #endif |
55 | 56 | ||
56 | |||
57 | namespace tut | 57 | namespace tut |
58 | { | 58 | { |
59 | std::string sSourceDir; | ||
60 | |||
59 | test_runner_singleton runner; | 61 | test_runner_singleton runner; |
60 | } | 62 | } |
61 | 63 | ||
@@ -68,7 +70,6 @@ public: | |||
68 | mPassedTests(0), | 70 | mPassedTests(0), |
69 | mFailedTests(0), | 71 | mFailedTests(0), |
70 | mSkippedTests(0), | 72 | mSkippedTests(0), |
71 | mSkippedFailTests(0), | ||
72 | mStream(stream) | 73 | mStream(stream) |
73 | { | 74 | { |
74 | } | 75 | } |
@@ -107,10 +108,6 @@ public: | |||
107 | break; | 108 | break; |
108 | case tut::test_result::skip: | 109 | case tut::test_result::skip: |
109 | ++mSkippedTests; | 110 | ++mSkippedTests; |
110 | out << "skipped"; | ||
111 | break; | ||
112 | case tut::test_result::skip_fail: | ||
113 | ++mSkippedFailTests; | ||
114 | out << "skipped known failure"; | 111 | out << "skipped known failure"; |
115 | break; | 112 | break; |
116 | default: | 113 | default: |
@@ -159,12 +156,7 @@ private: | |||
159 | 156 | ||
160 | if (mSkippedTests > 0) | 157 | if (mSkippedTests > 0) |
161 | { | 158 | { |
162 | stream << "Skipped Tests: " << mSkippedTests << std::endl; | 159 | stream << "Skipped known failures: " << mSkippedTests |
163 | } | ||
164 | |||
165 | if (mSkippedFailTests > 0) | ||
166 | { | ||
167 | stream << "Skipped known failures: " << mSkippedFailTests | ||
168 | << std::endl; | 160 | << std::endl; |
169 | } | 161 | } |
170 | 162 | ||
@@ -183,7 +175,6 @@ protected: | |||
183 | int mPassedTests; | 175 | int mPassedTests; |
184 | int mFailedTests; | 176 | int mFailedTests; |
185 | int mSkippedTests; | 177 | int mSkippedTests; |
186 | int mSkippedFailTests; | ||
187 | std::ostream *mStream; | 178 | std::ostream *mStream; |
188 | }; | 179 | }; |
189 | 180 | ||
@@ -194,7 +185,7 @@ static const apr_getopt_option_t TEST_CL_OPTIONS[] = | |||
194 | {"verbose", 'v', 0, "Verbose output."}, | 185 | {"verbose", 'v', 0, "Verbose output."}, |
195 | {"group", 'g', 1, "Run test group specified by option argument."}, | 186 | {"group", 'g', 1, "Run test group specified by option argument."}, |
196 | {"output", 'o', 1, "Write output to the named file."}, | 187 | {"output", 'o', 1, "Write output to the named file."}, |
197 | {"skip", 's', 1, "Skip test number specified by option argument. Only works when a specific group is being tested"}, | 188 | {"sourcedir", 's', 1, "Project source file directory from CMake."}, |
198 | {"touch", 't', 1, "Touch the given file if all tests succeed"}, | 189 | {"touch", 't', 1, "Touch the given file if all tests succeed"}, |
199 | {"wait", 'w', 0, "Wait for input before exit."}, | 190 | {"wait", 'w', 0, "Wait for input before exit."}, |
200 | {"debug", 'd', 0, "Emit full debug logs."}, | 191 | {"debug", 'd', 0, "Emit full debug logs."}, |
@@ -226,8 +217,6 @@ void stream_usage(std::ostream& s, const char* app) | |||
226 | s << "\tList all available test groups." << std::endl; | 217 | s << "\tList all available test groups." << std::endl; |
227 | s << " " << app << " --group=uuid" << std::endl; | 218 | s << " " << app << " --group=uuid" << std::endl; |
228 | s << "\tRun the test group 'uuid'." << std::endl; | 219 | s << "\tRun the test group 'uuid'." << std::endl; |
229 | s << " " << app << " --skip=2" << std::endl; | ||
230 | s << "\tSkip test case 2." << std::endl; | ||
231 | } | 220 | } |
232 | 221 | ||
233 | void stream_groups(std::ostream& s, const char* app) | 222 | void stream_groups(std::ostream& s, const char* app) |
@@ -276,7 +265,6 @@ int main(int argc, char **argv) | |||
276 | // values used for controlling application | 265 | // values used for controlling application |
277 | bool verbose_mode = false; | 266 | bool verbose_mode = false; |
278 | bool wait_at_exit = false; | 267 | bool wait_at_exit = false; |
279 | int skip_test_id = 0; | ||
280 | std::string test_group; | 268 | std::string test_group; |
281 | 269 | ||
282 | // values use for options parsing | 270 | // values use for options parsing |
@@ -302,9 +290,6 @@ int main(int argc, char **argv) | |||
302 | case 'g': | 290 | case 'g': |
303 | test_group.assign(opt_arg); | 291 | test_group.assign(opt_arg); |
304 | break; | 292 | break; |
305 | case 's': | ||
306 | skip_test_id = atoi(opt_arg); | ||
307 | break; | ||
308 | case 'h': | 293 | case 'h': |
309 | stream_usage(std::cout, argv[0]); | 294 | stream_usage(std::cout, argv[0]); |
310 | return 0; | 295 | return 0; |
@@ -319,6 +304,11 @@ int main(int argc, char **argv) | |||
319 | output = new std::ofstream; | 304 | output = new std::ofstream; |
320 | output->open(opt_arg); | 305 | output->open(opt_arg); |
321 | break; | 306 | break; |
307 | case 's': // --sourcedir | ||
308 | tut::sSourceDir = opt_arg; | ||
309 | // For convenience, so you can use tut::sSourceDir + "myfile" | ||
310 | tut::sSourceDir += '/'; | ||
311 | break; | ||
322 | case 't': | 312 | case 't': |
323 | touch = opt_arg; | 313 | touch = opt_arg; |
324 | break; | 314 | break; |
@@ -347,7 +337,7 @@ int main(int argc, char **argv) | |||
347 | } | 337 | } |
348 | else | 338 | else |
349 | { | 339 | { |
350 | tut::runner.get().run_tests(test_group, skip_test_id); | 340 | tut::runner.get().run_tests(test_group); |
351 | } | 341 | } |
352 | 342 | ||
353 | if (wait_at_exit) | 343 | if (wait_at_exit) |