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
This commit is contained in:
fbarchard@google.com 2012-09-14 15:35:34 +00:00
parent b8eabfea64
commit 6ccda3d206
4 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,6 @@
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 351
Version: 352
License: BSD
License File: LICENSE

View File

@ -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

View File

@ -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) {

View File

@ -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_;
};