| 457 | |
| 458 | |
| 459 | int |
| 460 | main(int argc, char* argv[]) { |
| 461 | using namespace Test; |
| 462 | #ifdef GECODE_HAS_MTRACE |
| 463 | mtrace(); |
| 464 | #endif |
| 465 | |
| 466 | opt.parse(argc, argv); |
| 467 | |
| 468 | Base::sort(); |
| 469 | |
| 470 | if (opt.list) { |
| 471 | for (Base* t = Base::tests() ; t != nullptr; t = t->next() ) { |
| 472 | std::cout << t->name() << std::endl; |
| 473 | } |
| 474 | exit(EXIT_SUCCESS); |
| 475 | } |
| 476 | |
| 477 | std::vector<Base*> tests; |
| 478 | bool started = opt.start_from == nullptr ? true : false; |
| 479 | for (Base* t = Base::tests() ; t != nullptr; t = t->next() ) { |
| 480 | if (!started) { |
| 481 | if (t->name().find(opt.start_from) != std::string::npos) { |
| 482 | started = true; |
| 483 | } else { |
| 484 | continue; |
| 485 | } |
| 486 | } |
| 487 | if (opt.is_test_name_matching(t->name())) { |
| 488 | tests.emplace_back(t); |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | if (opt.threads > 1) { |
| 493 | return run_tests_parallel(tests, opt); |
| 494 | } else { |
| 495 | return run_tests(tests, opt); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | std::ostream& |
| 500 | operator<<(std::ostream& os, const Test::ind& i) { |
nothing calls this directly
no test coverage detected