Bug 161217 - Add run-webkit-tests --print-expectations to show expectations for all or a subset of tests
Summary: Add run-webkit-tests --print-expectations to show expectations for all or a s...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Simon Fraser (smfr)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-25 15:43 PDT by Simon Fraser (smfr)
Modified: 2016-08-27 11:11 PDT (History)
8 users (show)

See Also:


Attachments
Patch (13.13 KB, patch)
2016-08-25 17:24 PDT, Simon Fraser (smfr)
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Fraser (smfr) 2016-08-25 15:43:38 PDT
Add run-webkit-tests --print-expectations to show expectations for all or a subset of tests
Comment 1 Simon Fraser (smfr) 2016-08-25 17:24:33 PDT
Created attachment 287051 [details]
Patch
Comment 2 Simon Fraser (smfr) 2016-08-25 17:25:07 PDT
Sample output:

 282$ $ wktests --debug --print-expectations --ios-simulator -1 LayoutTests/fast/viewport/ios/
Found 9 tests; running 6, skipping 3.

Tests to skip (3)
fast/viewport/ios/force-always-user-scalable.html                                                 ['SKIP'] LayoutTests/TestExpectations:21 fast/viewport/ios [ Skip ]
fast/viewport/ios/user-scalable-does-not-scale-for-keyboard-focus-with-author-defined-scale.html  ['SKIP'] LayoutTests/TestExpectations:21 fast/viewport/ios [ Skip ]
fast/viewport/ios/user-scalable-scales-for-keyboard-focus-with-no-author-defined-scale.html       ['SKIP'] LayoutTests/TestExpectations:21 fast/viewport/ios [ Skip ]

Tests to run (6)
fast/viewport/ios/ipad/width-is-device-width.html                                                 ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:11 fast/viewport/ios/ipad/width-is-device-width.html [ Pass ]
fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall.html                ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:10 fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden-tall.html [ Pass ]
fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden.html                     ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:9 fast/viewport/ios/width-is-device-width-overflowing-body-overflow-hidden.html [ Pass ]
fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit.html                         ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:8 fast/viewport/ios/width-is-device-width-overflowing-no-shrink-to-fit.html [ Pass ]
fast/viewport/ios/width-is-device-width-overflowing.html                                          ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:7 fast/viewport/ios/width-is-device-width-overflowing.html [ Pass ]
fast/viewport/ios/width-is-device-width.html                                                      ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:6 fast/viewport/ios/width-is-device-width.html [ Pass ]

Tests to run for ipad (1)
fast/viewport/ios/ipad/width-is-device-width.html                                                 ['PASS'] LayoutTests/platform/ios-simulator-wk1/TestExpectations:11 fast/viewport/ios/ipad/width-is-device-width.html [ Pass ]
Comment 3 Ryosuke Niwa 2016-08-25 19:23:00 PDT
Comment on attachment 287051 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=287051&action=review

> Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:529
> +        format_string = '{lb}:{width}{rb} {lb}{rb} {lb}{rb} {lb}{rb}'.format(lb='{', rb='}', width=test_col_width)

Why don't we just hard use {{ and }} instead?  ({{ would format as {).

> Tools/Scripts/webkitpy/layout_tests/controllers/manager.py:536
> +                line = self._expectations.model().get_expectation_line(test)
> +                print format_string.format(test, line.expected_behavior, self._expectations.readable_filename_and_line_number(line), line.original_string)

Can we just define a helper function to share this code between here and the loop below?
You can even create a lambda function in this function and call it.
Comment 4 Simon Fraser (smfr) 2016-08-27 11:11:33 PDT
https://trac.webkit.org/changeset/205080