Pass a list of tuples containing test classes and the starting string of the functions used for testing. Example: main ([(vtkTestClass, 'test'), (vtkTestClass1, 'test')])
(cases)
| 375 | return |
| 376 | |
| 377 | def main(cases): |
| 378 | """ Pass a list of tuples containing test classes and the starting |
| 379 | string of the functions used for testing. |
| 380 | |
| 381 | Example: |
| 382 | |
| 383 | main ([(vtkTestClass, 'test'), (vtkTestClass1, 'test')]) |
| 384 | """ |
| 385 | |
| 386 | processCmdLine() |
| 387 | |
| 388 | timer = vtkTimerLog() |
| 389 | s_time = timer.GetCPUTime() |
| 390 | s_wall_time = time.time() |
| 391 | |
| 392 | # run the tests |
| 393 | result = test(cases) |
| 394 | |
| 395 | tot_time = timer.GetCPUTime() - s_time |
| 396 | tot_wall_time = float(time.time() - s_wall_time) |
| 397 | |
| 398 | # output measurements for CDash |
| 399 | print("<DartMeasurement name=\"WallTime\" type=\"numeric/double\"> " |
| 400 | " %f </DartMeasurement>"%tot_wall_time) |
| 401 | print("<DartMeasurement name=\"CPUTime\" type=\"numeric/double\"> " |
| 402 | " %f </DartMeasurement>"%tot_time) |
| 403 | |
| 404 | # Delete these to eliminate debug leaks warnings. |
| 405 | del cases, timer |
| 406 | |
| 407 | if result.wasSuccessful(): |
| 408 | sys.exit(0) |
| 409 | else: |
| 410 | sys.exit(1) |
| 411 | |
| 412 | |
| 413 | def test(cases): |
no test coverage detected