4 | | int main ( int, char const *[] ) { |
| 6 | using namespace itpp; |
| 7 | |
| 8 | Array<const char *> selected_tests; |
| 9 | |
| 10 | bool is_selected_test( const UnitTest::Test *test ) { |
| 11 | it_assert_debug ( test, "NULL test" ); |
| 12 | |
| 13 | if (!selected_tests.length()) { |
| 14 | return true; |
| 15 | } |
| 16 | |
| 17 | for (int i = 0; i < selected_tests.length(); ++i) { |
| 18 | const char *n = test->m_details.testName; |
| 19 | it_assert_debug ( n, "NULL test name" ); |
| 20 | const char *sname = selected_tests(i); |
| 21 | it_assert_debug ( sname, "NULL selected test name" ); |
| 22 | if ( !strcmp ( n, sname ) ) { |
| 23 | return true; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | return false; |
| 28 | } |
| 29 | |
| 30 | int main ( int argc, char const *argv[] ) { |
| 31 | if ( argc > 1 ) { |
| 32 | selected_tests.set_length( argc - 1 ); |
| 33 | const char **param = argv + 1; |
| 34 | int i = 0; |
| 35 | while ( *param ) { |
| 36 | selected_tests ( i ) = *param; |
| 37 | ++i; |
| 38 | ++param; |
| 39 | } |
| 40 | } |
| 41 | |