Changeset 84518 in webkit


Ignore:
Timestamp:
Apr 21, 2011 10:43:24 AM (13 years ago)
Author:
ojan@chromium.org
Message:

2011-04-20 Ojan Vafai <ojan@chromium.org>

Reviewed by Tony Chang.

put unexpected passes into their own table
https://bugs.webkit.org/show_bug.cgi?id=59016

  • Scripts/webkitpy/layout_tests/layout_package/json_results.html:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84514 r84518  
     12011-04-20  Ojan Vafai  <ojan@chromium.org>
     2
     3        Reviewed by Tony Chang.
     4
     5        put unexpected passes into their own table
     6        https://bugs.webkit.org/show_bug.cgi?id=59016
     7
     8        * Scripts/webkitpy/layout_tests/layout_package/json_results.html:
     9
    1102011-04-20  Ojan Vafai  <ojan@chromium.org>
    211
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results.html

    r84514 r84518  
    99}
    1010
    11 tr:first-of-type:hover {
     11tbody tr:first-of-type:hover {
    1212    opacity: 0.7
    1313}
     
    120120            newTests: [],
    121121            results: {},
    122             testsWithStderr: []
     122            testsWithStderr: [],
     123            unexpectedPassTests: []
    123124        }
    124125    }
     
    270271
    271272        var expected = globalState().results.tests[test].expected || 'PASS';
    272         if (actual == 'PASS' && (!globalState().results.uses_expectations_file || expected == 'PASS'))
    273           continue;
     273        var isExpected = actual == 'SKIP';
     274        if (!isExpected && globalState().results.uses_expectations_file) {
     275            var expectedArray = expected.split(' ');
     276            if (expectedArray.indexOf(actual) != -1)
     277                isExpected = true;
     278            else if (expectedArray.indexOf('FAIL') != -1)
     279                isExpected = actual == 'IMAGE' || actual == 'TEXT' || actual == 'IMAGE+TEXT';
     280        }
     281
     282        if (actual == 'PASS') {
     283            if (!isExpected && expected != 'PASS')
     284                globalState().unexpectedPassTests.push(test);           
     285            continue;
     286        }
    274287
    275288        // FIXME: put unexpected passes in a separate table.
     
    322335          row += '<td>' + expected + '</td>';
    323336
    324         var isExpected = actual == 'SKIP';
    325         if (!isExpected && globalState().results.uses_expectations_file) {
    326             var expectedArray = expected.split(' ');
    327             if (expectedArray.indexOf(actual) != -1)
    328                 isExpected = true;
    329             else if (expectedArray.indexOf('FAIL') != -1)
    330                 isExpected = actual == 'IMAGE' || actual == 'TEXT' || actual == 'IMAGE+TEXT';
    331         }
    332337        html += '<tbody class="' + (isExpected ? 'expected' : '') + '"><tr>' + row + '</tr></tbody>';
    333338    }
     
    335340}
    336341
    337 function testList(tests, header, tableId, fileSuffix, linkName)
     342function testList(tests, header, tableId)
    338343{
    339344    tests.sort();
    340345
    341346    var html = '<p>' + header + '</p><table id="' + tableId + '">';
     347
     348    if (tableId == 'passes-table')
     349        html += '<thead><th>test</th><th>expected failure type</th>';
     350
    342351    for (var i = 0; i < tests.length; i++) {
    343352        var test = tests[i];
    344353        html += '<tbody><tr><td>' + testLink(test) + '</td><td>';
    345354       
    346         if (fileSuffix.indexOf('actual') == -1)
    347             html += resultLink(stripExtension(test), fileSuffix, linkName);
    348         else {
     355        if (tableId == 'stderr-table')
     356            html += resultLink(stripExtension(test), '-stderr.txt', 'stderr');
     357        else if (tableId == 'passes-table')
     358            html += globalState().results.tests[test].expected;
     359        else if (tableId == 'new-tests-table') {
    349360            var testObject = globalState().results.tests[test];
    350361            if (testObject.is_missing_audio)
    351362                html += resultLink(stripExtension(test), '-actual.wav', 'audio result');
    352363            if (testObject.is_missing_text)
    353                 html += resultLink(stripExtension(test), fileSuffix, linkName);
     364                html += resultLink(stripExtension(test), '-actual.txt', 'result');
    354365            if (testObject.is_missing_image)
    355366                html += resultLink(stripExtension(test), '-actual.png', 'png result');
     
    563574
    564575    if (globalState().newTests.length)
    565         html += testList(globalState().newTests, 'Tests that had no expected results (probably new):', 'new-tests-table', '-actual.txt', 'result');
     576        html += testList(globalState().newTests, 'Tests that had no expected results (probably new):', 'new-tests-table');
    566577
    567578    if (globalState().testsWithStderr.length)
    568         html += testList(globalState().testsWithStderr, 'Tests that had stderr output:', 'stderr-table', '-stderr.txt', 'stderr');
     579        html += testList(globalState().testsWithStderr, 'Tests that had stderr output:', 'stderr-table');
     580
     581    if (globalState().unexpectedPassTests.length)
     582        html += testList(globalState().unexpectedPassTests, 'Tests expected to fail but passed:', 'passes-table');
    569583
    570584    if (globalState().hasHttpTests) {
  • trunk/Tools/Scripts/webkitpy/layout_tests/layout_package/json_results_test.js

    r84514 r84518  
    100100    });
    101101
     102    results = mockResults();
     103    results.tests['foo/bar.html'] = mockExpectation('TEXT', 'PASS');
     104    results.tests['foo/bar1.html'] = mockExpectation('CRASH', 'PASS');
     105    results.tests['foo/bar2.html'] = mockExpectation('IMAGE', 'PASS');
     106    runTest(results, function() {
     107        assertTrue(!document.getElementById('results-table'));
     108
     109        var testLinks = document.querySelectorAll('#passes-table .test-link');
     110        assertTrue(testLinks[0].textContent == 'foo/bar.html');
     111        assertTrue(testLinks[1].textContent == 'foo/bar1.html');
     112        assertTrue(testLinks[2].textContent == 'foo/bar2.html');
     113
     114        var expectationTypes = document.querySelectorAll('#passes-table td:last-of-type');
     115        assertTrue(expectationTypes[0].textContent == 'TEXT');
     116        assertTrue(expectationTypes[1].textContent == 'CRASH');
     117        assertTrue(expectationTypes[2].textContent == 'IMAGE');
     118
     119    });
     120
    102121    document.body.innerHTML = '<pre>' + g_log.join('\n') + '</pre>';
    103122}
Note: See TracChangeset for help on using the changeset viewer.