diff --git a/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java b/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java index 0c6008ccf7..f7e18eed05 100644 --- a/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java +++ b/platform_tools/android/apps/skqp/src/main/java/org/skia/skqp/SkQPRunner.java @@ -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())); diff --git a/site/dev/testing/skqp.md b/site/dev/testing/skqp.md index 904922f59f..791fb8fdf2 100644 --- a/site/dev/testing/skqp.md +++ b/site/dev/testing/skqp.md @@ -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: diff --git a/tools/skqp/README.md b/tools/skqp/README.md index 627cfbca6a..7885f85d4b 100644 --- a/tools/skqp/README.md +++ b/tools/skqp/README.md @@ -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: diff --git a/tools/skqp/test_apk.sh b/tools/skqp/test_apk.sh index 6492174841..039f529cfa 100755 --- a/tools/skqp/test_apk.sh +++ b/tools/skqp/test_apk.sh @@ -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=''