commit | af9d565869e58e8caf0bae5228f173bada628184 | [log] [tgz] |
---|---|---|
author | Raymond Chiu <chiur@google.com> | Mon Oct 01 15:44:23 2018 -0700 |
committer | Raymond Chiu <chiur@google.com> | Mon Oct 01 22:52:36 2018 +0000 |
tree | 68f99316edc10dee28648e017d630e4976054d31 | |
parent | b09f393b4c9c87884ba77314bb7039ac27dadae8 [diff] |
Improve functional test error reporting The first line of the stack trace is printed in the report. Add error message to vulkan 1.1 test failure. Test: none Change-Id: Ibac98fb38b508b2453a75d751a748a485070f1f6
diff --git a/hostside/src/com/android/game/qualification/reporter/GameQualificationResultReporter.java b/hostside/src/com/android/game/qualification/reporter/GameQualificationResultReporter.java index b4bd61c..f26c300 100644 --- a/hostside/src/com/android/game/qualification/reporter/GameQualificationResultReporter.java +++ b/hostside/src/com/android/game/qualification/reporter/GameQualificationResultReporter.java
@@ -180,6 +180,17 @@ for (TestDescription test : testRunResult.getFailedTests()) { sb.append('\t'); sb.append(test.toString()); + + // Prints the first line of the stacktrace. + TestResult result = testRunResult.getTestResults().get(test); + String stacktrace = result.getStackTrace(); + if (!stacktrace.isEmpty()) { + sb.append("\n\t\t"); + sb.append( + stacktrace.contains("\n") + ? stacktrace.split("\n", 2)[0] + : stacktrace); + } sb.append('\n'); } }
diff --git a/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java b/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java index 9eeca07..096bb8a 100644 --- a/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java +++ b/instrumentation_tests/java_tests/src/com/android/game/qualification/tests/VulkanTest.java
@@ -32,7 +32,9 @@ @Test public void support1_1() { PackageManager pm = InstrumentationRegistry.getTargetContext().getPackageManager(); - assertTrue(pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1)); + assertTrue( + "Device must support Vulkan 1.1", + pm.hasSystemFeature(PackageManager.FEATURE_VULKAN_HARDWARE_VERSION, VULKAN_1_1)); } }