Merge "More CTS Test Runner Fixes" into froyo
diff --git a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
index b865c75..c978919 100644
--- a/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
+++ b/tests/tests/app/src/android/app/cts/SystemFeaturesTest.java
@@ -38,7 +38,6 @@
import java.lang.reflect.Field;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -240,17 +239,19 @@
int phoneType = mTelephonyManager.getPhoneType();
switch (phoneType) {
case TelephonyManager.PHONE_TYPE_GSM:
- assertTelephonyFeatures(PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_GSM);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY_GSM);
break;
case TelephonyManager.PHONE_TYPE_CDMA:
- assertTelephonyFeatures(PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_CDMA);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertAvailable(PackageManager.FEATURE_TELEPHONY_CDMA);
break;
case TelephonyManager.PHONE_TYPE_NONE:
- assertTelephonyFeatures();
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY);
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY_CDMA);
+ assertNotAvailable(PackageManager.FEATURE_TELEPHONY_GSM);
break;
default:
@@ -258,40 +259,6 @@
}
}
- /**
- * Checks that the given features are enabled and also that all the other telephony features
- * are disabled.
- *
- * @param expectedFeaturesEnabled that {@link PackageManager} should report
- */
- private void assertTelephonyFeatures(String... expectedFeaturesEnabled) {
- // Create sets of enabled and disabled features.
- Set<String> enabledFeatures = new HashSet<String>();
- Collections.addAll(enabledFeatures, expectedFeaturesEnabled);
-
- Set<String> disabledFeatures = new HashSet<String>();
- Collections.addAll(disabledFeatures,
- PackageManager.FEATURE_TELEPHONY,
- PackageManager.FEATURE_TELEPHONY_GSM,
- PackageManager.FEATURE_TELEPHONY_CDMA);
- disabledFeatures.removeAll(enabledFeatures);
-
- // Get all available features to test not only hasFeature but getSystemAvailableFeatures.
- PackageManager packageManager = mContext.getPackageManager();
- Set<String> availableFeatures = new HashSet<String>();
- for (FeatureInfo featureInfo : packageManager.getSystemAvailableFeatures()) {
- availableFeatures.add(featureInfo.name);
- }
-
- for (String feature : enabledFeatures) {
- assertAvailable(feature);
- }
-
- for (String feature : disabledFeatures) {
- assertNotAvailable(feature);
- }
- }
-
public void testTouchScreenFeatures() {
ConfigurationInfo configInfo = mActivityManager.getDeviceConfigurationInfo();
if (configInfo.reqTouchScreen != Configuration.TOUCHSCREEN_NOTOUCH) {
diff --git a/tools/host/src/com/android/cts/CtsTestResult.java b/tools/host/src/com/android/cts/CtsTestResult.java
index 0aea74b..851b07d 100644
--- a/tools/host/src/com/android/cts/CtsTestResult.java
+++ b/tools/host/src/com/android/cts/CtsTestResult.java
@@ -157,7 +157,7 @@
int resCode = CODE_PASS;
String failedMessage = null;
String stackTrace = null;
- if ((testResult != null) && (testResult.failureCount() > 0)) {
+ if ((testResult != null) && (testResult.failureCount() > 0 || testResult.errorCount() > 0)) {
resCode = CODE_FAIL;
Enumeration<TestFailure> failures = testResult.failures();
while (failures.hasMoreElements()) {
@@ -165,6 +165,12 @@
failedMessage += failure.exceptionMessage();
stackTrace += failure.trace();
}
+ Enumeration<TestFailure> errors = testResult.errors();
+ while (errors.hasMoreElements()) {
+ TestFailure failure = errors.nextElement();
+ failedMessage += failure.exceptionMessage();
+ stackTrace += failure.trace();
+ }
}
mResultCode = resCode;
mFailedMessage = failedMessage;
diff --git a/tools/host/src/res/cts_result.xsl b/tools/host/src/res/cts_result.xsl
index 758f7ea..bd82f82 100644
--- a/tools/host/src/res/cts_result.xsl
+++ b/tools/host/src/res/cts_result.xsl
@@ -33,333 +33,350 @@
<TD width="40%" align="left"><img src="logo.gif"></img></TD>
<TD width="60%" align="left">
<h1>Test Report for <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/> -
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
- </h1>
- </TD>
- </TR>
- </TABLE>
- </DIV>
- <img src="newrule-green.png" align="left"></img>
-
- <br></br>
- <br></br>
-
- <!-- Header with phone and plan information -->
- <DIV id="summary">
- <TABLE width="90%" frame="none">
- <TR>
- <TH>Device Information</TH>
- <TH>Test Summary</TH>
- </TR>
-
- <TR>
- <TD>
- <!-- Device information -->
- <div id="summaryinfo">
- <TABLE width="75%">
- <TR>
- <TD class="rowtitle">Build Model</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build Name</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildName"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Device ID</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Firmware Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Firmware Build Number</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildID"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build Fingerprint</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_fingerprint"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build ABI</TD>
- <TD>
- <xsl:value-of
- select="TestResult/DeviceInfo/BuildInfo/@build_abi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Build ABI2</TD>
- <TD>
- <xsl:value-of
- select="TestResult/DeviceInfo/BuildInfo/@build_abi2"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Android Platform Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@androidPlatformVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Supported Locales</TD>
- <TD>
- <xsl:call-template name="formatDelimitedString">
- <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@locales"/>
- </xsl:call-template>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Screen size</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/Screen/@resolution"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Phone number</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/PhoneSubInfo/@subscriberId"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">x dpi</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Xdpi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">y dpi</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Ydpi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Touch</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@touch"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Navigation</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@navigation"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Keypad</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@keypad"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Network</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@network"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">IMEI</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imei"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">IMSI</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imsi"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Open GL ES Version</TD>
- <TD>
- <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@openGlEsVersion"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Features</TD>
- <TD>
- <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='sdk']">
- <xsl:text>[</xsl:text>
- <xsl:choose>
- <xsl:when test="@available = 'true'">
- <xsl:text>X</xsl:text>
- </xsl:when>
- <xsl:otherwise>
- <xsl:text>_</xsl:text>
- </xsl:otherwise>
- </xsl:choose>
- <xsl:text>] </xsl:text>
-
- <xsl:value-of select="@name" />
- <br />
- </xsl:for-each>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Other Features</TD>
- <TD>
- <UL>
- <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='other']">
- <LI><xsl:value-of select="@name" /></LI>
- </xsl:for-each>
- </UL>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Root Processes</TD>
- <TD>
- <UL>
- <xsl:for-each select="TestResult/DeviceInfo/ProcessInfo/Process[@uid='0']">
- <LI><xsl:value-of select="@name" /></LI>
- </xsl:for-each>
- </UL>
- </TD>
- </TR>
- </TABLE>
- </div>
- </TD>
-
- <!-- plan information -->
- <TD>
- <div id="summaryinfo">
- <TABLE width="75%">
- <TR>
- <TD class="rowtitle">CTS version</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/Cts/@version"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Test timeout</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/Cts/IntValue[@name='testStatusTimeoutMs']/@value" /> ms
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Host Info</TD>
- <TD>
- <xsl:value-of select="TestResult/HostInfo/@name"/>
- (<xsl:value-of select="TestResult/HostInfo/Os/@name"/> -
- <xsl:value-of select="TestResult/HostInfo/Os/@version"/>)
- </TD>
- </TR>
- <TR><TD><BR></BR></TD><TD></TD></TR>
- <TR>
- <TD class="rowtitle">Plan name</TD>
- <TD>
- <xsl:value-of select="TestResult/@testPlan"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Profile</TD>
- <TD>
- <xsl:value-of select="TestResult/@profile"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Start time</TD>
- <TD>
- <xsl:value-of select="TestResult/@starttime"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">End time</TD>
- <TD>
- <xsl:value-of select="TestResult/@endtime"/>
- </TD>
- </TR>
-
- <!-- Test Summary -->
- <TR><TD><BR></BR></TD><TD></TD></TR>
- <TR>
- <TD class="rowtitle">Tests Passed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@pass"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Failed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@failed"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Timed out</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@timeout"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Omitted</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@omitted"/>
- </TD>
- </TR>
- <TR>
- <TD class="rowtitle">Tests Not Executed</TD>
- <TD>
- <xsl:value-of select="TestResult/Summary/@notExecuted"/>
- </TD>
- </TR>
- </TABLE>
- </div>
- </TD>
- </TR>
- </TABLE>
- </DIV>
-
- <!-- High level summary of test execution -->
- <h2 align="center">Test Summary by Package</h2>
- <DIV id="testsummary">
- <TABLE>
- <TR>
- <TH>Test Package</TH>
- <TH>Passed</TH>
- <TH>Failed</TH>
- <TH>Timed Out</TH>
- <TH>Total Tests</TH>
- </TR>
- <xsl:for-each select="TestResult/TestPackage">
- <TR>
- <TD>
- <xsl:variable name="href"><xsl:value-of select="@name"/></xsl:variable>
- <a href="#{$href}"><xsl:value-of select="@name"/></a>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'pass'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'fail'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test[@result = 'timeout'])"/>
- </TD>
- <TD>
- <xsl:value-of select="count(TestSuite//Test)"/>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
+ </h1>
</TD>
</TR>
- </xsl:for-each> <!-- end package -->
- </TABLE>
- </DIV>
+ </TABLE>
+ </DIV>
+ <img src="newrule-green.png" align="left"></img>
- <!-- Details of all the executed tests -->
- <h2 align="center">Detailed Test Report</h2>
+ <br></br>
+ <br></br>
- <!-- test package -->
- <DIV id="testdetail">
- <xsl:for-each select="TestResult/TestPackage">
+ <!-- Header with phone and plan information -->
+ <DIV id="summary">
+ <TABLE width="90%" frame="none">
+ <TR>
+ <TH>Device Information</TH>
+ <TH>Test Summary</TH>
+ </TR>
+
+ <TR>
+ <TD>
+ <!-- Device information -->
+ <div id="summaryinfo">
+ <TABLE width="75%">
+ <TR>
+ <TD class="rowtitle">Build Model</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_model"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Name</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildName"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Device ID</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@deviceID"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Firmware Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Firmware Build Number</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@buildID"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build Fingerprint</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@build_fingerprint"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build ABI</TD>
+ <TD>
+ <xsl:value-of
+ select="TestResult/DeviceInfo/BuildInfo/@build_abi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Build ABI2</TD>
+ <TD>
+ <xsl:value-of
+ select="TestResult/DeviceInfo/BuildInfo/@build_abi2"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Android Platform Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@androidPlatformVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Supported Locales</TD>
+ <TD>
+ <xsl:call-template name="formatDelimitedString">
+ <xsl:with-param name="string" select="TestResult/DeviceInfo/BuildInfo/@locales"/>
+ </xsl:call-template>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Screen size</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/Screen/@resolution"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Phone number</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/PhoneSubInfo/@subscriberId"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">x dpi</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Xdpi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">y dpi</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@Ydpi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Touch</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@touch"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Navigation</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@navigation"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Keypad</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@keypad"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Network</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@network"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">IMEI</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imei"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">IMSI</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@imsi"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Open GL ES Version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/DeviceInfo/BuildInfo/@openGlEsVersion"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Features</TD>
+ <TD>
+ <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='sdk']">
+ <xsl:text>[</xsl:text>
+ <xsl:choose>
+ <xsl:when test="@available = 'true'">
+ <xsl:text>X</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:text>_</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text>] </xsl:text>
+
+ <xsl:value-of select="@name" />
+ <br />
+ </xsl:for-each>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Other Features</TD>
+ <TD>
+ <UL>
+ <xsl:for-each select="TestResult/DeviceInfo/FeatureInfo/Feature[@type='other']">
+ <LI><xsl:value-of select="@name" /></LI>
+ </xsl:for-each>
+ </UL>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Root Processes</TD>
+ <TD>
+ <UL>
+ <xsl:for-each select="TestResult/DeviceInfo/ProcessInfo/Process[@uid='0']">
+ <LI><xsl:value-of select="@name" /></LI>
+ </xsl:for-each>
+ </UL>
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+ </TD>
+
+ <!-- plan information -->
+ <TD>
+ <div id="summaryinfo">
+ <TABLE width="75%">
+ <TR>
+ <TD class="rowtitle">CTS version</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/Cts/@version"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Test timeout</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/Cts/IntValue[@name='testStatusTimeoutMs']/@value" /> ms
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Host Info</TD>
+ <TD>
+ <xsl:value-of select="TestResult/HostInfo/@name"/>
+ (<xsl:value-of select="TestResult/HostInfo/Os/@name"/> -
+ <xsl:value-of select="TestResult/HostInfo/Os/@version"/>)
+ </TD>
+ </TR>
+ <TR><TD><BR></BR></TD><TD></TD></TR>
+ <TR>
+ <TD class="rowtitle">Plan name</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@testPlan"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Start time</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@starttime"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">End time</TD>
+ <TD>
+ <xsl:value-of select="TestResult/@endtime"/>
+ </TD>
+ </TR>
+
+ <!-- Test Summary -->
+ <TR><TD><BR></BR></TD><TD></TD></TR>
+ <TR>
+ <TD class="rowtitle">Tests Passed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@pass"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Failed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@failed"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Timed out</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@timeout"/>
+ </TD>
+ </TR>
+ <TR>
+ <TD class="rowtitle">Tests Not Executed</TD>
+ <TD>
+ <xsl:value-of select="TestResult/Summary/@notExecuted"/>
+ </TD>
+ </TR>
+ </TABLE>
+ </div>
+ </TD>
+ </TR>
+ </TABLE>
+ </DIV>
+
+ <!-- High level summary of test execution -->
+ <h2 align="center">Test Summary by Package</h2>
+ <DIV id="testsummary">
+ <TABLE>
+ <TR>
+ <TH>Test Package</TH>
+ <TH>Passed</TH>
+ <TH>Failed</TH>
+ <TH>Timed Out</TH>
+ <TH>Total Tests</TH>
+ </TR>
+ <xsl:for-each select="TestResult/TestPackage">
+ <TR>
+ <TD>
+ <xsl:variable name="href"><xsl:value-of select="@name"/></xsl:variable>
+ <a href="#{$href}"><xsl:value-of select="@name"/></a>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'pass'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'fail'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test[@result = 'timeout'])"/>
+ </TD>
+ <TD>
+ <xsl:value-of select="count(TestSuite//Test)"/>
+ </TD>
+ </TR>
+ </xsl:for-each> <!-- end package -->
+ </TABLE>
+ </DIV>
+
+ <xsl:call-template name="filteredResultTestReport">
+ <xsl:with-param name="header" select="'Test Failures'" />
+ <xsl:with-param name="resultFilter" select="'fail'" />
+ </xsl:call-template>
+
+ <xsl:call-template name="filteredResultTestReport">
+ <xsl:with-param name="header" select="'Test Timeouts'" />
+ <xsl:with-param name="resultFilter" select="'timeout'" />
+ </xsl:call-template>
+
+ <h2 align="center">Detailed Test Report</h2>
+ <xsl:call-template name="detailedTestReport" />
+
+ </body>
+ </html>
+ </xsl:template>
+
+ <xsl:template name="filteredResultTestReport">
+ <xsl:param name="header" />
+ <xsl:param name="resultFilter" />
+ <xsl:variable name="numMatching" select="count(TestResult/TestPackage/TestSuite//TestCase/Test[@result=$resultFilter])" />
+ <xsl:if test="$numMatching > 0">
+ <h2 align="center"><xsl:value-of select="$header" /> (<xsl:value-of select="$numMatching"/>)</h2>
+ <xsl:call-template name="detailedTestReport">
+ <xsl:with-param name="resultFilter" select="$resultFilter"/>
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template name="detailedTestReport">
+ <xsl:param name="resultFilter" />
+ <DIV id="testdetail">
+ <xsl:for-each select="TestResult/TestPackage">
+ <xsl:if test="$resultFilter=''
+ or count(TestSuite//TestCase/Test[@result=$resultFilter]) > 0">
<DIV id="none">
<TABLE>
<TR>
@@ -381,113 +398,108 @@
<!-- test case -->
<xsl:for-each select="TestSuite//TestCase">
- <!-- emit a blank row before every test suite name -->
- <xsl:if test="position()!=1">
- <TR> <TD class="testcasespacer" colspan="3"></TD> </TR>
+ <xsl:if test="$resultFilter='' or count(Test[@result=$resultFilter]) > 0">
+ <!-- emit a blank row before every test suite name -->
+ <xsl:if test="position()!=1">
+ <TR><TD class="testcasespacer" colspan="3"></TD></TR>
+ </xsl:if>
+
+ <TR>
+ <TD class="testcase" colspan="3">
+ <xsl:for-each select="ancestor::TestSuite">
+ <xsl:if test="position()!=1">.</xsl:if>
+ <xsl:value-of select="@name"/>
+ </xsl:for-each>
+ <xsl:text>.</xsl:text>
+ <xsl:value-of select="@name"/>
+ </TD>
+ </TR>
</xsl:if>
- <TR>
- <TD class="testcase" colspan="3">
- <xsl:for-each select="ancestor::TestSuite">
- <xsl:if test="position()!=1">.</xsl:if>
- <xsl:value-of select="@name"/>
- </xsl:for-each>
- <xsl:text>.</xsl:text>
- <xsl:value-of select="@name"/>
- </TD>
- </TR>
<!-- test -->
<xsl:for-each select="Test">
- <TR>
- <TD class="testname"> -- <xsl:value-of select="@name"/></TD>
+ <xsl:if test="$resultFilter='' or $resultFilter=@result">
+ <TR>
+ <TD class="testname"> -- <xsl:value-of select="@name"/></TD>
- <!-- test results -->
- <xsl:choose>
- <xsl:when test="string(@KnownFailure)">
- <!-- "pass" indicates the that test actually passed (results have been inverted already) -->
- <xsl:if test="@result='pass'">
- <TD class="pass">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- known problem
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
+ <!-- test results -->
+ <xsl:choose>
+ <xsl:when test="string(@KnownFailure)">
+ <!-- "pass" indicates the that test actually passed (results have been inverted already) -->
+ <xsl:if test="@result='pass'">
+ <TD class="pass">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ known problem
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
- <!-- "fail" indicates that a known failure actually passed (results have been inverted already) -->
- <xsl:if test="@result='fail'">
- <TD class="failed">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails">
- <div id="details">
- A test that was a known failure actually passed. Please check.
- </div>
- </TD>
- </xsl:if>
- </xsl:when>
+ <!-- "fail" indicates that a known failure actually passed (results have been inverted already) -->
+ <xsl:if test="@result='fail'">
+ <TD class="failed">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails">
+ <div id="details">
+ A test that was a known failure actually passed. Please check.
+ </div>
+ </TD>
+ </xsl:if>
+ </xsl:when>
- <xsl:otherwise>
- <xsl:if test="@result='pass'">
- <TD class="pass">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
+ <xsl:otherwise>
+ <xsl:if test="@result='pass'">
+ <TD class="pass">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
- <xsl:if test="@result='fail'">
- <TD class="failed">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails">
- <div id="details">
- <xsl:value-of select="FailedScene/@message"/>
- </div>
- </TD>
- </xsl:if>
+ <xsl:if test="@result='fail'">
+ <TD class="failed">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails">
+ <div id="details">
+ <xsl:value-of select="FailedScene/@message"/>
+ </div>
+ </TD>
+ </xsl:if>
- <xsl:if test="@result='timeout'">
- <TD class="timeout">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- <TD class="failuredetails"></TD>
- </TD>
- </xsl:if>
+ <xsl:if test="@result='timeout'">
+ <TD class="timeout">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ <TD class="failuredetails"></TD>
+ </TD>
+ </xsl:if>
- <xsl:if test="@result='omitted'">
- <TD class="omitted">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
-
- <xsl:if test="@result='notExecuted'">
- <TD class="notExecuted">
- <div style="text-align: center; margin-left:auto; margin-right:auto;">
- <xsl:value-of select="@result"/>
- </div>
- </TD>
- <TD class="failuredetails"></TD>
- </xsl:if>
- </xsl:otherwise>
- </xsl:choose>
- </TR> <!-- finished with a row -->
+ <xsl:if test="@result='notExecuted'">
+ <TD class="notExecuted">
+ <div style="text-align: center; margin-left:auto; margin-right:auto;">
+ <xsl:value-of select="@result"/>
+ </div>
+ </TD>
+ <TD class="failuredetails"></TD>
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+ </TR> <!-- finished with a row -->
+ </xsl:if>
</xsl:for-each> <!-- end test -->
</xsl:for-each> <!-- end test case -->
</TABLE>
- </xsl:for-each> <!-- end test package -->
- </DIV>
- </body>
- </html>
+ </xsl:if>
+ </xsl:for-each> <!-- end test package -->
+ </DIV>
</xsl:template>
<!-- Take a delimited string and insert line breaks after a some number of elements. -->
diff --git a/tools/vm-tests/src/util/build/BuildDalvikSuite.java b/tools/vm-tests/src/util/build/BuildDalvikSuite.java
index f28a71b..48c8087 100644
--- a/tools/vm-tests/src/util/build/BuildDalvikSuite.java
+++ b/tools/vm-tests/src/util/build/BuildDalvikSuite.java
@@ -76,6 +76,7 @@
private static String restrictTo = null; // e.g. restrict to
// "opcodes.add_double"
+ private static final String TARGET_JAR_ROOT_PATH = "/data/local/tmp";
private int testClassCnt = 0;
private int testMethodsCnt = 0;
@@ -275,13 +276,14 @@
private void addCTSHostMethod(String pName, String method, MethodData md,
Set<String> dependentTestClassNames) {
+ final String targetCoreJarPath = String.format("%s/dexcore.jar", TARGET_JAR_ROOT_PATH);
curJunitFileData+="public void "+method+ "() throws Exception {\n";
curJunitFileData+= " "+getADBPushJavaLine("dot/junit/dexcore.jar",
- "/data/dexcore.jar");
+ targetCoreJarPath);
// push class with Main jar.
String mjar = "Main_"+method+".jar";
- String mainJar = "/data/"+mjar;
+ String mainJar = String.format("%s/%s", TARGET_JAR_ROOT_PATH, mjar);
String pPath = pName.replaceAll("\\.","/");
//System.out.println("adb push "+pPath+"/"+mjar +" "+mainJar);
curJunitFileData+= " "+getADBPushJavaLine(pPath+"/"+mjar, mainJar);
@@ -289,10 +291,10 @@
// for each dependency:
// adb push dot/junit/opcodes/add_double_2addr/Main_testN2.jar
// /data/Main_testN2.jar
- String cp = "/data/dexcore.jar:"+mainJar;
+ String cp = String.format("%s:%s", targetCoreJarPath, mainJar);
for (String depFqcn : dependentTestClassNames) {
int lastDotPos = depFqcn.lastIndexOf('.');
- String targetName= "/data/"+depFqcn.substring(lastDotPos +1)+".jar";
+ String targetName= TARGET_JAR_ROOT_PATH+depFqcn.substring(lastDotPos +1)+".jar";
String sourceName = depFqcn.replaceAll("\\.", "/")+".jar";
//System.out.println("adb push "+sourceName+" "+targetName);
curJunitFileData+= " "+getADBPushJavaLine(sourceName, targetName);
@@ -307,10 +309,6 @@
curJunitFileData+= "}\n\n";
}
-
-
-
-
private void handleTests() throws IOException {
System.out.println("collected "+testMethodsCnt+" test methods in " +
testClassCnt+" junit test classes");