From 6ccda3d20647c77c19ea279253b0c7d3f019f866 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Fri, 14 Sep 2012 15:35:34 +0000 Subject: [PATCH] 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 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- unit_test/unit_test.cc | 6 ++++++ unit_test/unit_test.h | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.chromium b/README.chromium index 7883f4c9e..d9ab1089d 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 351 +Version: 352 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index ca08dc58e..81f32e813 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 351 +#define LIBYUV_VERSION 352 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index 8a22afea4..e590fa4d4 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -12,6 +12,8 @@ #include +#include // 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) { diff --git a/unit_test/unit_test.h b/unit_test/unit_test.h index a49d5ba42..754d7171b 100644 --- a/unit_test/unit_test.h +++ b/unit_test/unit_test.h @@ -66,7 +66,7 @@ class libyuvTest : public ::testing::Test { const int rotate_max_w_; const int rotate_max_h_; - const int benchmark_iterations_; + int benchmark_iterations_; const int benchmark_width_; const int benchmark_height_; };