Number of test in test case

349 views
Skip to first unread message

xuxu

unread,
Jun 5, 2010, 1:05:42 PM6/5/10
to Google C++ Testing Framework
Can I get number of test in a test case or number of test at the all
program?

I found that I can see the tests' name before the tests run can I also
find the total number?

thanks

Ratko Kovacina

unread,
Jun 5, 2010, 1:41:35 PM6/5/10
to xuxu, Google C++ Testing Framework
At the end of every execution you get the total number of tests and test cases that were executed. 

You could get the number of tests within a test case or overall number without executing them by using grep and 'wc -l' (in linux/unix) combined with the --gtest_list_tests option.

Ratko.

xuxu

unread,
Jun 6, 2010, 2:55:58 PM6/6/10
to Google C++ Testing Framework
Can I get only the names without the result?


On Jun 5, 8:41 pm, Ratko Kovacina <rkovac...@gmail.com> wrote:
> At the end of every execution you get the total number of tests and test
> cases that were executed.
>
> You could get the number of tests within a test case or overall number
> without executing them by using grep and 'wc -l' (in linux/unix) combined
> with the --gtest_list_tests option.
>
> Ratko.
>

Ratko Kovacina

unread,
Jun 6, 2010, 3:05:19 PM6/6/10
to xuxu, Google C++ Testing Framework
use the option:

--gtest_list_tests 

It will not run tests - it will provide just list of testcase/test names 

xuxu

unread,
Jun 6, 2010, 4:59:54 PM6/6/10
to Google C++ Testing Framework
thanks a lot for your answer but I'm having a problem with it.
how do I use
--gtest_list_tests ?

I wrote:
testing::GTEST_FLAG(list_tests);
but it seems that only if I hsve the macro :
RUN_ALL_TESTS();
I got the tests names


On Jun 6, 10:05 pm, Ratko Kovacina <rkovac...@gmail.com> wrote:
> use the option:
>
> --gtest_list_tests
>
> It will not run tests - it will provide just list of testcase/test names
>
Reply all
Reply to author
Forward
0 new messages