diff options
author | fbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90> | 2012-09-14 15:35:34 +0000 |
---|---|---|
committer | fbarchard@google.com <fbarchard@google.com@16f28f9a-4ce2-e073-06de-1de4eb20be90> | 2012-09-14 15:35:34 +0000 |
commit | 6ccda3d20647c77c19ea279253b0c7d3f019f866 (patch) | |
tree | b25fae2682b89f21cf582129df25f7b85bd1fcf8 /unit_test/unit_test.cc | |
parent | b8eabfea6487a4be3c1497a7ba7c9e2ab2f5f46d (diff) | |
download | libyuv-6ccda3d20647c77c19ea279253b0c7d3f019f866.tar.gz |
Add environment variable for tests to repeat for benchmarking purposes.
BUG=none
TEST=none
Review URL: https://webrtc-codereview.appspot.com/796006
git-svn-id: http://libyuv.googlecode.com/svn/trunk@352 16f28f9a-4ce2-e073-06de-1de4eb20be90
Diffstat (limited to 'unit_test/unit_test.cc')
-rw-r--r-- | unit_test/unit_test.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index 8a22afea..e590fa4d 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -12,6 +12,8 @@ #include <cstring> +#include <stdlib.h> // For getenv() + // Change this to 1000 for benchmarking. // TODO(fbarchard): Add command line parsing to pass this as option. #define BENCHMARK_ITERATIONS 1 @@ -19,6 +21,10 @@ libyuvTest::libyuvTest() : rotate_max_w_(128), rotate_max_h_(128), benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(1280), benchmark_height_(720) { + const char* repeat = getenv("LIBYUV_REPEAT"); + if (repeat) { + benchmark_iterations_ = atoi(repeat); + } } int main(int argc, char** argv) { |