harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r579276 - in /harmony/enhanced/buildtest/branches/2.0/tests/eut: ./ summary-reporter/src/org/apache/harmony/eut/reporter/
Date Tue, 25 Sep 2007 14:49:55 GMT
Author: smishura
Date: Tue Sep 25 07:49:54 2007
New Revision: 579276

URL: http://svn.apache.org/viewvc?rev=579276&view=rev
Log:
Apply patch from HARMONY-4835:
([buildtest][eut] Expected Crashes must be considered by summary reporter)

Modified:
    harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.2.efl
    harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.3.efl
    harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTHTMLSummaryEmitter.java
    harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTReporter.java
    harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTSuiteInfo.java
    harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTTXTReportEmitter.java

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.2.efl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.2.efl?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.2.efl (original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.2.efl Tue Sep 25 07:49:54 2007
@@ -6,14 +6,14 @@
 # index.htm files by ./build.xml using information from 
 # results/<date>/results/xml/*.xml and results/<date>/output.txt.
 #
-# The following rule is used to create this file:
+# The following rules are used to create this file:
+#
+# - specify test suite name to expect failure for all tests in suite, like
+#   "org.eclipse.jdt.ui.tests.LeakTestSuite"
 #
 # - specify particular test name to expect its failure, the test name 
 #   is to be taken from results\<date>\results\xml\*.xml, like
 #   "org.eclipse.jdt.core.tests.compiler.regression.LookupTest.test044 - 1.4"
-#
-# - no expected crashes is possible - there shoould be no crashes
-#
 
 ###############################################################################
 #

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.3.efl
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.3.efl?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.3.efl (original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/eut3.3.efl Tue Sep 25 07:49:54 2007
@@ -6,14 +6,14 @@
 # index.htm files by ./build.xml using information from 
 # results/<date>/results/xml/*.xml and results/<date>/output.txt.
 #
-# The following rule is used to create this file:
+# The following rules are used to create this file:
+#
+# - specify test suite name to expect failure for all tests in suite, like
+#   "org.eclipse.jdt.ui.tests.LeakTestSuite"
 #
 # - specify particular test name to expect its failure, the test name 
 #   is to be taken from results\<date>\results\xml\*.xml, like
 #   "org.eclipse.jdt.core.tests.compiler.regression.LookupTest.test044 - 1.4"
-#
-# - no expected crashes is possible - there shoould be no crashes
-#
 
 ###############################################################################
 #

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTHTMLSummaryEmitter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTHTMLSummaryEmitter.java?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTHTMLSummaryEmitter.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTHTMLSummaryEmitter.java
Tue Sep 25 07:49:54 2007
@@ -31,9 +31,8 @@
 
         emitiHTMLheaderAndBodyStart(esi.eut_version);
         emitRelativeSummary(esi.ss, esi.tests_run_total,
-                esi.tests_crashed_total);
-        emitAbsoluteSummary(esi.ss, esi.tests_run_total,
-                esi.tests_crashed_total);
+                esi.tests_unexpected_crashed_total);
+        emitAbsoluteSummary(esi.ss, esi.tests_crashed_total);
         emitNoteOfErrorFailures();
         emitNoteOfSummary();
         emitSuitesStatictics();
@@ -116,16 +115,16 @@
     }
 
     private static void emitRelativeSummary(EUTSuiteInfo ss,
-            int tests_run_total, int tests_crashed_total) {
+            int tests_run_total, int tests_unexpected_crashed_total) {
         emitSummary("Relative Summary", "Sudden",
                 tests_run_total, ss.tests_reported_passed, 
                 ss.tests_unexpected_end_with_failure, 
                 ss.tests_unexpected_end_with_error,
-                tests_crashed_total);
+                tests_unexpected_crashed_total);
     }
 
     private static void emitAbsoluteSummary(EUTSuiteInfo ss,
-            int tests_run_total, int tests_crashed_total) {
+            int tests_crashed_total) {
         emitSummary("Absolute Summary", "Total",
                 ss.tests_total, ss.tests_reported_passed, 
                 ss.tests_reported_end_with_failure, 
@@ -189,7 +188,7 @@
         String strCrash = "&nbsp;";
 
         // detect report style based on issue type
-        if (si.isCrashed) {
+        if (si.isCrashed && !si.isCrashExpected) {
             tClass = "Error";
             strError = "&nbsp;";
             strFailure = "&nbsp;";
@@ -198,6 +197,10 @@
             tClass = "Failure";
         }  else if (si.tests_unexpected_end_with_failure != 0) {
             tClass = "Failure";
+        }
+
+        if (si.isCrashed && si.isCrashExpected) {
+            strCrash = "expected crash";
         }
 
         // emit html code finally

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTReporter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTReporter.java?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTReporter.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTReporter.java
Tue Sep 25 07:49:54 2007
@@ -172,7 +172,7 @@
         // caclulate summary statictics
         EUTSummaryInfo esi = new EUTSummaryInfo();
         esi.ss = new EUTSuiteInfo(); // Summary Suite
-        esi.crashed_suites = new ArrayList<EUTSuiteInfo>();
+        esi.suites_unexpected_crashed = new ArrayList<EUTSuiteInfo>();
 
         for (int i = 0; i < suiteList.size(); i++) {
             EUTSuiteInfo si = suiteList.get(i);
@@ -191,13 +191,24 @@
                     si.tests_unexpected_end_with_failure;
 
             if (si.wasRun) {
+
+                // if suite was crashed then we remove 0 value
                 esi.tests_run_total += si.tests_total;
                 esi.tests_run_total -= si.tests_expected_failures_errors;
 
                 if (si.isCrashed) {
                     esi.tests_crashed_total += si.tests_total;
-                    esi.suites_crashed_total++;
-                    esi.crashed_suites.add(si);
+
+                    // the crash may be expected
+                    if (eflList.indexOf(si.name) != -1) {
+                        si.isCrashExpected = true;
+
+                        // must not count expected crashed suite tests number
+                        esi.tests_run_total -= si.tests_total;
+                    } else {
+                        esi.tests_unexpected_crashed_total += si.tests_total;
+                        esi.suites_unexpected_crashed.add(si);
+                    }
                 }
             }
         }
@@ -225,6 +236,7 @@
         System.out.println("EUT SCRIPT: "
                 + "EUT summary report was successfully generated");
 
+        // produce an exit code based on EUT run results
         if (esi.tests_run_total == esi.ss.tests_reported_passed) {
             System.out.println("EUT SCRIPT: "
                     + "No unexpected EUT issues detected");

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTSuiteInfo.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTSuiteInfo.java?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTSuiteInfo.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTSuiteInfo.java
Tue Sep 25 07:49:54 2007
@@ -50,6 +50,11 @@
      */
     boolean isCrashed;
 
+    /**
+     * The crashed suite may be expected according to EFL.
+     */
+    boolean isCrashExpected;
+ 
     /** 
      * Shows if the suite is available for platform the program is run on.
      * Like org.eclipse.jdt.core.tests.eval.TestAll is available for Windows
@@ -165,10 +170,10 @@
  */
 final class EUTSummaryInfo {
     EUTSuiteInfo ss; // Summary Suite
-    int tests_run_total = 0; // need for Relative Summary
-    int tests_crashed_total = 0;
-    int suites_crashed_total = 0;
-    ArrayList<EUTSuiteInfo> crashed_suites;
+    int tests_run_total; // need for Relative Summary
+    int tests_crashed_total;
+    int tests_unexpected_crashed_total;
+    ArrayList<EUTSuiteInfo> suites_unexpected_crashed;
     String eut_version;
     String os, ws, arch;
     String tested_vm_ags;

Modified: harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTTXTReportEmitter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTTXTReportEmitter.java?rev=579276&r1=579275&r2=579276&view=diff
==============================================================================
--- harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTTXTReportEmitter.java
(original)
+++ harmony/enhanced/buildtest/branches/2.0/tests/eut/summary-reporter/src/org/apache/harmony/eut/reporter/EUTTXTReportEmitter.java
Tue Sep 25 07:49:54 2007
@@ -50,7 +50,7 @@
         out.println("Total run tests     : " + esi.tests_run_total);
         out.println("Relative passrate   : " + EUTReporter.makePassrateString(
                     esi.ss.tests_reported_passed, esi.tests_run_total));
-        out.println("Unexpected crashes  : " + esi.suites_crashed_total);
+        out.println("Unexpected crashes  : " + esi.suites_unexpected_crashed.size());
         out.println("Unexpected errors   : "
                 + esi.ss.tests_unexpected_end_with_error);
         out.println("Unexpected failures : "
@@ -76,15 +76,16 @@
     }
 
     private static void emitCrashesResults(EUTSummaryInfo esi) {
-        if (esi.crashed_suites.size() == 0) {
+        if (esi.suites_unexpected_crashed.size() == 0) {
             return;
         }
         out.println();
         out.println("================================================");
-        out.println("Unexpected crashes  : " + esi.suites_crashed_total);
+        out.println("Unexpected crashes  : "
+                + esi.suites_unexpected_crashed.size());
 
-        for (int i = 0; i < esi.crashed_suites.size(); i++) {
-            EUTSuiteInfo si = esi.crashed_suites.get(i);
+        for (int i = 0; i < esi.suites_unexpected_crashed.size(); i++) {
+            EUTSuiteInfo si = esi.suites_unexpected_crashed.get(i);
             out.println(si.name + "(" + si.tests_total + ")");
         }
     }
@@ -117,7 +118,7 @@
                     continue;
                 }
                 out.println();
-                out.println(ti.testClass + ti.testName);
+                out.println(ti.testClass + '.' + ti.testName);
                 out.println(ti.testIssueMessage);
                 out.println(ti.testIssueContent.toString().trim());
             }



Mime
View raw message