chenxiaoqun / libyuv

Automatically exported from code.google.com/p/libyuv
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

add command line options to unittests #85

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
gunit provides command line parsing, which is useful for benchmarking and to 
save images out.

Does gtest provide similar options?

Original issue reported on code.google.com by fbarch...@google.com on 13 Sep 2012 at 9:48

GoogleCodeExporter commented 9 years ago
instead of command line, which doesnt seem to be supported, the unittests use 
an environment variable.

set LIBYUV_REPEAT=1000
build\release\libyuv_unittest.exe --gtest_catch_exceptions=0 
--gtest_filter=*RGBA*
Note: Google Test filter = *RGBA*
[==========] Running 6 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 6 tests from libyuvTest
[ RUN      ] libyuvTest.ARGBToRGBA_OptVsC
[       OK ] libyuvTest.ARGBToRGBA_OptVsC (531 ms)
[ RUN      ] libyuvTest.ARGBToRGBAInvert_OptVsC
[       OK ] libyuvTest.ARGBToRGBAInvert_OptVsC (530 ms)
[ RUN      ] libyuvTest.RGBAToARGB_OptVsC
[       OK ] libyuvTest.RGBAToARGB_OptVsC (531 ms)
[ RUN      ] libyuvTest.RGBAToARGBInvert_OptVsC
[       OK ] libyuvTest.RGBAToARGBInvert_OptVsC (515 ms)
[ RUN      ] libyuvTest.ARGBToRGBA_Random
[       OK ] libyuvTest.ARGBToRGBA_Random (109 ms)
[ RUN      ] libyuvTest.RGBAToARGB_Random
[       OK ] libyuvTest.RGBAToARGB_Random (125 ms)
[----------] 6 tests from libyuvTest (2356 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 1 test case ran. (2356 ms total)
[  PASSED  ] 6 tests.

This allows the default to be running all the tests once, which takes about 10 
seconds, but repeating for benchmarking, which takes about 5 minutes if run for 
all tests, or a few seconds per test.

Fix in r352

Original comment by fbarch...@chromium.org on 14 Sep 2012 at 6:01