Commit 913bc473 by Cody Northrop Committed by Commit Bot

Tests: Add --fixed-test-time option

Similar to --max-steps-performed, don't do any calibration and just run flat out for a fixed amount of time. Also rename --test-time to --max-trial-time to reflect what the parameter actually does, limiting each trial to a ceiling. Also remove a redundant check in doRunLoop. Test: angle_perftests --fixed-test-time 20 Test: angle_perftests --max-trial-time 2 Bug: angleproject:5935 Change-Id: I854799a734cd6c019399f5a1444b4ef5f659ddf4 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2878937Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCharlie Lao <cclao@google.com> Commit-Queue: Cody Northrop <cnorthrop@google.com>
parent 74177f31
...@@ -284,7 +284,7 @@ void ANGLEPerfTest::run() ...@@ -284,7 +284,7 @@ void ANGLEPerfTest::run()
for (uint32_t trial = 0; trial < numTrials; ++trial) for (uint32_t trial = 0; trial < numTrials; ++trial)
{ {
doRunLoop(gTestTimeSeconds, mStepsToRun, RunLoopPolicy::RunContinuously); doRunLoop(gMaxTrialTimeSeconds, mStepsToRun, RunLoopPolicy::RunContinuously);
printResults(); printResults();
if (gVerboseLogging) if (gVerboseLogging)
{ {
...@@ -363,10 +363,6 @@ void ANGLEPerfTest::doRunLoop(double maxRunTime, int maxStepsToRun, RunLoopPolic ...@@ -363,10 +363,6 @@ void ANGLEPerfTest::doRunLoop(double maxRunTime, int maxStepsToRun, RunLoopPolic
{ {
mRunning = false; mRunning = false;
} }
else if (gMaxStepsPerformed > 0 && mTotalNumStepsPerformed >= gMaxStepsPerformed)
{
mRunning = false;
}
} }
} }
finishTest(); finishTest();
......
...@@ -21,7 +21,7 @@ const char *gTraceFile = "ANGLETrace.json"; ...@@ -21,7 +21,7 @@ const char *gTraceFile = "ANGLETrace.json";
const char *gScreenShotDir = nullptr; const char *gScreenShotDir = nullptr;
bool gVerboseLogging = false; bool gVerboseLogging = false;
double gCalibrationTimeSeconds = 1.0; double gCalibrationTimeSeconds = 1.0;
double gTestTimeSeconds = 10.0; double gMaxTrialTimeSeconds = 10.0;
int gTestTrials = 3; int gTestTrials = 3;
bool gNoFinish = false; bool gNoFinish = false;
bool gEnableAllTraceTests = false; bool gEnableAllTraceTests = false;
...@@ -85,10 +85,19 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv) ...@@ -85,10 +85,19 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv)
} }
else if (strcmp("--max-steps-performed", argv[argIndex]) == 0 && argIndex < *argc - 1) else if (strcmp("--max-steps-performed", argv[argIndex]) == 0 && argIndex < *argc - 1)
{ {
gMaxStepsPerformed = ReadIntArgument(argv[argIndex + 1]); gMaxStepsPerformed = ReadIntArgument(argv[argIndex + 1]);
gWarmupLoops = 0; gWarmupLoops = 0;
gTestTrials = 1; gTestTrials = 1;
gTestTimeSeconds = 36000; gMaxTrialTimeSeconds = 36000;
// Skip an additional argument.
argIndex++;
}
else if (strcmp("--fixed-test-time", argv[argIndex]) == 0 && argIndex < *argc - 1)
{
gMaxTrialTimeSeconds = ReadIntArgument(argv[argIndex + 1]);
gStepsPerTrial = std::numeric_limits<int>::max();
gTestTrials = 1;
gWarmupLoops = 0;
// Skip an additional argument. // Skip an additional argument.
argIndex++; argIndex++;
} }
...@@ -122,9 +131,9 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv) ...@@ -122,9 +131,9 @@ void ANGLEProcessPerfTestArgs(int *argc, char **argv)
// Skip an additional argument. // Skip an additional argument.
argIndex++; argIndex++;
} }
else if (strcmp("--test-time", argv[argIndex]) == 0) else if (strcmp("--max-trial-time", argv[argIndex]) == 0)
{ {
gTestTimeSeconds = ReadIntArgument(argv[argIndex + 1]); gMaxTrialTimeSeconds = ReadIntArgument(argv[argIndex + 1]);
// Skip an additional argument. // Skip an additional argument.
argIndex++; argIndex++;
} }
......
...@@ -23,7 +23,7 @@ extern const char *gScreenShotDir; ...@@ -23,7 +23,7 @@ extern const char *gScreenShotDir;
extern bool gVerboseLogging; extern bool gVerboseLogging;
extern int gWarmupLoops; extern int gWarmupLoops;
extern double gCalibrationTimeSeconds; extern double gCalibrationTimeSeconds;
extern double gTestTimeSeconds; extern double gMaxTrialTimeSeconds;
extern int gTestTrials; extern int gTestTrials;
extern bool gNoFinish; extern bool gNoFinish;
extern bool gEnableAllTraceTests; extern bool gEnableAllTraceTests;
......
...@@ -34,7 +34,8 @@ Several command-line arguments control how the tests run: ...@@ -34,7 +34,8 @@ Several command-line arguments control how the tests run:
* `--warmup-loops x`: Number of times to warm up the test before starting timing. Defaults to 3. * `--warmup-loops x`: Number of times to warm up the test before starting timing. Defaults to 3.
* `--no-warmup`: Skip warming up the tests. Equivalent to `--warmup-steps 0`. * `--no-warmup`: Skip warming up the tests. Equivalent to `--warmup-steps 0`.
* `--calibration-time`: Run each test calibration step in a fixed time. Defaults to 1 second. * `--calibration-time`: Run each test calibration step in a fixed time. Defaults to 1 second.
* `--test-time`: Run each test trial in a fixed time. Defaults to 10 seconds. * `--max-trial-time x`: Run each test trial under this max time. Defaults to 10 seconds.
* `--fixed-test-time x`: Run the tests until this much time has elapsed.
* `--trials`: Number of times to repeat testing. Defaults to 3. * `--trials`: Number of times to repeat testing. Defaults to 3.
* `--no-finish`: Don't call glFinish after each test trial. * `--no-finish`: Don't call glFinish after each test trial.
* `--enable-all-trace-tests`: Offscreen and vsync-limited trace tests are disabled by default to reduce test time. * `--enable-all-trace-tests`: Offscreen and vsync-limited trace tests are disabled by default to reduce test time.
......
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