Commit 981f0f8f by Jamie Madill Committed by Commit Bot

Add flag to do a fast pass through perf tests.

This flag will only render the first frame of each perf test, regardless of their preferences for how many seconds to run. It will be useful for speeding up the run time of the perf tests on testing infrastructure that only cares about correctness. BUG=chromium:725308 BUG=chromium:765321 Change-Id: I926f488c42f27ef23ef06a0159902613cff04080 Reviewed-on: https://chromium-review.googlesource.com/677306Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 2bc94733
...@@ -9,8 +9,18 @@ ...@@ -9,8 +9,18 @@
#include <gtest/gtest.h> #include <gtest/gtest.h>
extern bool g_OnlyOneRunFrame;
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
for (int i = 0; i < argc; ++i)
{
if (strcmp("--one-frame-only", argv[i]) == 0)
{
g_OnlyOneRunFrame = true;
}
}
testing::InitGoogleTest(&argc, argv); testing::InitGoogleTest(&argc, argv);
testing::AddGlobalTestEnvironment(new testing::Environment()); testing::AddGlobalTestEnvironment(new testing::Environment());
int rt = RUN_ALL_TESTS(); int rt = RUN_ALL_TESTS();
......
...@@ -27,6 +27,8 @@ void OverrideWorkaroundsD3D(angle::PlatformMethods *platform, angle::Workarounds ...@@ -27,6 +27,8 @@ void OverrideWorkaroundsD3D(angle::PlatformMethods *platform, angle::Workarounds
} }
} // namespace } // namespace
bool g_OnlyOneRunFrame = false;
ANGLEPerfTest::ANGLEPerfTest(const std::string &name, const std::string &suffix) ANGLEPerfTest::ANGLEPerfTest(const std::string &name, const std::string &suffix)
: mName(name), : mName(name),
mSuffix(suffix), mSuffix(suffix),
...@@ -58,7 +60,7 @@ void ANGLEPerfTest::run() ...@@ -58,7 +60,7 @@ void ANGLEPerfTest::run()
{ {
++mNumStepsPerformed; ++mNumStepsPerformed;
} }
if (mTimer->getElapsedTime() > mRunTimeSeconds) if (mTimer->getElapsedTime() > mRunTimeSeconds || g_OnlyOneRunFrame)
{ {
mRunning = false; mRunning = false;
} }
......
...@@ -120,4 +120,6 @@ class ANGLERenderTest : public ANGLEPerfTest ...@@ -120,4 +120,6 @@ class ANGLERenderTest : public ANGLEPerfTest
angle::PlatformMethods mPlatformMethods; angle::PlatformMethods mPlatformMethods;
}; };
extern bool g_OnlyOneRunFrame;
#endif // PERF_TESTS_ANGLE_PERF_TEST_H_ #endif // PERF_TESTS_ANGLE_PERF_TEST_H_
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment