SkQP: rely on TestRunner for logging
BEFORE: V org.skia.skqp: Rendering Test 'gles_lcdtextsize' started (411/890). I TestRunner: started: gles_lcdtextsize(org.skia.skqp.SkQPRunner) I org.skia.skqp: Rendering Test 'gles_lcdtextsize' passed I TestRunner: finished: gles_lcdtextsize(org.skia.skqp.SkQPRunner) AFTER: I TestRunner: started: gles_lcdtextsize(org.skia.skqp.SkQPRunner) I TestRunner: finished: gles_lcdtextsize(org.skia.skqp.SkQPRunner) I org.skia.skqp: Rendering Test 'gles_lcdtextsize' complete (411/890). [pass] Change-Id: I40632ac1dc06da2395de83564580c0e490bc6e18 Reviewed-on: https://skia-review.googlesource.com/c/163786 Commit-Queue: Hal Canary <halcanary@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com> Auto-Submit: Hal Canary <halcanary@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
parent
2e8f48e387
commit
355d698ce6
@ -106,17 +106,16 @@ public class SkQPRunner extends Runner implements Filterable {
|
||||
|
||||
@Override
|
||||
public void run(RunNotifier notifier) {
|
||||
int testNumber = 1; // out of number of actually run tests.
|
||||
int testNumber = 0; // out of number of actually run tests.
|
||||
int testIndex = 0; // out of potential tests.
|
||||
for (int backend = 0; backend < impl.mBackends.length; backend++) {
|
||||
for (int gm = 0; gm < impl.mGMs.length; gm++, testIndex++) {
|
||||
++testNumber;
|
||||
Description desc = mTests[testIndex];
|
||||
String name = desc.getMethodName();
|
||||
if (mShouldSkipTest[testIndex]) {
|
||||
continue;
|
||||
}
|
||||
Log.v(TAG, String.format("Rendering Test '%s' started (%d/%d).",
|
||||
name, testNumber++, mShouldRunTestCount));
|
||||
notifier.fireTestStarted(desc);
|
||||
float value = java.lang.Float.MAX_VALUE;
|
||||
String error = null;
|
||||
@ -125,40 +124,43 @@ public class SkQPRunner extends Runner implements Filterable {
|
||||
} catch (SkQPException exept) {
|
||||
error = exept.getMessage();
|
||||
}
|
||||
String result = "pass";
|
||||
if (error != null) {
|
||||
SkQPRunner.Fail(desc, notifier, String.format("Exception: %s", error));
|
||||
Log.w(TAG, String.format("[ERROR] '%s': %s", name, error));
|
||||
result = "ERROR";
|
||||
} else if (value != 0) {
|
||||
SkQPRunner.Fail(desc, notifier, String.format(
|
||||
"Image mismatch: max channel diff = %f", value));
|
||||
Log.w(TAG, String.format("[FAIL] '%s': %f > 0", name, value));
|
||||
} else {
|
||||
Log.i(TAG, String.format("Rendering Test '%s' passed", name));
|
||||
result = "FAIL";
|
||||
}
|
||||
notifier.fireTestFinished(desc);
|
||||
Log.i(TAG, String.format("Rendering Test '%s' complete (%d/%d). [%s]",
|
||||
name, testNumber, mShouldRunTestCount, result));
|
||||
}
|
||||
}
|
||||
for (int unitTest = 0; unitTest < impl.mUnitTests.length; unitTest++, testIndex++) {
|
||||
++testNumber;
|
||||
Description desc = mTests[testIndex];
|
||||
String name = desc.getMethodName();
|
||||
if (mShouldSkipTest[testIndex]) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Log.v(TAG, String.format("Test '%s' started (%d/%d).",
|
||||
name, testNumber++, mShouldRunTestCount));
|
||||
notifier.fireTestStarted(desc);
|
||||
String[] errors = impl.nExecuteUnitTest(unitTest);
|
||||
String result = "pass";
|
||||
if (errors != null && errors.length > 0) {
|
||||
Log.w(TAG, String.format("[FAIL] Test '%s' had %d failures.", name, errors.length));
|
||||
for (String error : errors) {
|
||||
SkQPRunner.Fail(desc, notifier, error);
|
||||
Log.w(TAG, String.format("[FAIL] '%s': %s", name, error));
|
||||
}
|
||||
} else {
|
||||
Log.i(TAG, String.format("Test '%s' passed.", name));
|
||||
result = "FAIL";
|
||||
}
|
||||
notifier.fireTestFinished(desc);
|
||||
Log.i(TAG, String.format("Test '%s' complete (%d/%d). [%s]",
|
||||
name, testNumber, mShouldRunTestCount, result));
|
||||
}
|
||||
impl.nMakeReport();
|
||||
Log.i(TAG, String.format("output written to \"%s\"", GetOutputDir().getAbsolutePath()));
|
||||
|
@ -19,7 +19,7 @@ To run tests:
|
||||
|
||||
Monitor the output with:
|
||||
|
||||
adb logcat org.skia.skqp skia DEBUG "*:S"
|
||||
adb logcat TestRunner org.skia.skqp skia DEBUG "*:S"
|
||||
|
||||
Note the test's output path on the device. It will look something like this:
|
||||
|
||||
|
@ -68,7 +68,7 @@ How to build and run the SkQP tests
|
||||
|
||||
6. Monitor the output with:
|
||||
|
||||
adb logcat org.skia.skqp skia "*:S"
|
||||
adb logcat TestRunner org.skia.skqp skia "*:S"
|
||||
|
||||
Note the test's output path on the device. It will look something like this:
|
||||
|
||||
|
@ -48,7 +48,7 @@ filter() {
|
||||
adb install -r "$APK" || exit 2
|
||||
adb logcat -c
|
||||
|
||||
adb logcat org.skia.skqp skia DEBUG "*:S" | tee "${TDIR}/logcat.txt" | filter &
|
||||
adb logcat TestRunner org.skia.skqp skia DEBUG "*:S" | tee "${TDIR}/logcat.txt" | filter &
|
||||
LOGCAT_PID=$!
|
||||
|
||||
ADBSHELL_PID=''
|
||||
|
Loading…
Reference in New Issue
Block a user