protected void writeSuiteSummary() {

        int totalPassedTests = 0;
        int totalSkippedTests = 0;
        int totalFailedTests = 0;
        long totalDuration = 0;

        writer.print("<table>");
        writer.print("<tr>");
        writer.print("<th>Test</th>");
        writer.print("<th># Passed</th>");
        writer.print("<th># Skipped</th>");
        writer.print("<th># Failed</th>");
        writer.print("<th>Seconds</th>");
        writer.print("<th>Included Groups</th>");
        writer.print("<th>Excluded Groups</th>");
        writer.print("</tr>");

        int testIndex = 0;
        for ( SuiteResult suiteResult : suiteResults ) {
            writer.print("<tr><th colspan=\"7\">");
            writer.print( Utils.escapeHtml( suiteResult.getSuiteName() ) );
            writer.print("</th></tr>");

            for ( TestResult testResult : suiteResult.getTestResults() ) {
                int passedTests = testResult.getPassedTestCount();
                int skippedTests = testResult.getSkippedTestCount();
                int failedTests = testResult.getFailedTestCount();
                long duration = testResult.getDuration();

                writer.print("<tr");
                if ((testIndex % 2) == 1) {
                    writer.print(" class=\"stripe\"");
                }
                writer.print(">");

                buffer.setLength(0);
                writeTableData( buffer.append("<a href=\"#t").append(testIndex).append("\">")
                    .append(Utils.escapeHtml(testResult.getTestName())).append("</a>").toString());
                writeTableData( integerFormat.format(passedTests), "num");
                writeTableData( integerFormat.format(skippedTests), (skippedTests > 0 ? "num attn" : "num"));
                writeTableData( integerFormat.format(failedTests), (failedTests > 0 ? "num attn" : "num"));
                writeTableData( decimalFormat.format(millisecondsToSeconds(duration)), "num");
                writeTableData( testResult.getIncludedGroups() );
                writeTableData( testResult.getExcludedGroups() );

                writer.print("</tr>");

                totalPassedTests += passedTests;
                totalSkippedTests += skippedTests;
                totalFailedTests += failedTests;
                totalDuration += duration;

                testIndex++;
            }
        }

        // Print totals if there was more than one test
        if ( testIndex >= 1 ) {
            writer.print("<tr>");
            writer.print("<th>Total</th>");
            writeTableHeader( integerFormat.format(totalPassedTests), "num");
            writeTableHeader( integerFormat.format(totalSkippedTests), (totalSkippedTests > 0 ? "num attn" : "num"));
            writeTableHeader( integerFormat.format(totalFailedTests), (totalFailedTests > 0 ? "num attn" : "num"));
            writeTableHeader( decimalFormat.format(millisecondsToSeconds(totalDuration)), "num");
            writer.print("<th colspan=\"2\"></th>");
            writer.print("</tr>");
        }

        writer.print("</table>");
    }