Changeset 150286 in webkit


Ignore:
Timestamp:
May 17, 2013 12:33:19 PM (11 years ago)
Author:
ddkilzer@apple.com
Message:

filter-build-webkit: Don't filter out the location of the missing symbol when linking fails
Part 3 of 3: <http://webkit.org/b/116247>

Reviewed by Benjamin Poulain.

  • Scripts/filter-build-webkit: Change while() loop to for() loop

to track $previousLine, then pass $previousLine into
shouldIgnoreLine().
(shouldIgnoreLine): Add $previousLine argument. Do not skip a
line that begins with four spaces if the previous line is a
linker error message.

  • Scripts/webkitperl/filter-build-webkit_unittest/shouldIgnoreLine_unittests.pl:
  • Add "Ignored: " to test descriptions to document expected behavior.
  • Add comment blocks for various groups of tests.
  • Expand "Build settings" tests since we're changing the code in shouldIgnoreLine() that ignores those lines.
  • Add tests for undefined symbols error message.

(description): Add. Extract from global code.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r150285 r150286  
     12013-05-17  David Kilzer  <ddkilzer@apple.com>
     2
     3        filter-build-webkit: Don't filter out the location of the missing symbol when linking fails
     4        Part 3 of 3: <http://webkit.org/b/116247>
     5
     6        Reviewed by Benjamin Poulain.
     7
     8        * Scripts/filter-build-webkit: Change while() loop to for() loop
     9        to track $previousLine, then pass $previousLine into
     10        shouldIgnoreLine().
     11        (shouldIgnoreLine): Add $previousLine argument. Do not skip a
     12        line that begins with four spaces if the previous line is a
     13        linker error message.
     14        * Scripts/webkitperl/filter-build-webkit_unittest/shouldIgnoreLine_unittests.pl:
     15        - Add "Ignored: " to test descriptions to document expected
     16          behavior.
     17        - Add comment blocks for various groups of tests.
     18        - Expand "Build settings" tests since we're changing the code in
     19          shouldIgnoreLine() that ignores those lines.
     20        - Add tests for undefined symbols error message.
     21        (description): Add.  Extract from global code.
     22
    1232013-05-17  David Kilzer  <ddkilzer@apple.com>
    224
  • trunk/Tools/Scripts/filter-build-webkit

    r150285 r150286  
    6767sub setLogfileOption($$);
    6868sub setOutputFormatOption($$);
    69 sub shouldIgnoreLine($);
     69sub shouldIgnoreLine($$);
    7070sub usageAndExit();
    7171
     
    124124my $buildFinished;
    125125my $buildFailed = 0;
    126 while (my $line = <>) {
     126for (my $previousLine = "", my $line = <>; $line; $previousLine = $line, $line = <>) {
    127127    print UNFILTERED_OUTPUT_HANDLE $line if $logUnfilteredOutput;
    128128
    129129    chomp($line);
    130130
    131     next if shouldIgnoreLine($line);
     131    next if shouldIgnoreLine($previousLine, $line);
    132132
    133133    if ($line =~ /^={10}/) {
     
    212212}
    213213
    214 sub shouldIgnoreLine($)
    215 {
    216     my ($line) = @_;
     214sub shouldIgnoreLine($$)
     215{
     216    my ($previousLine, $line) = @_;
    217217
    218218    return 1 if $line =~ /^\s*$/;
     
    229229    return 1 if $line =~ /^# Lower case all the values, as CSS values are case-insensitive$/;
    230230    return 1 if $line =~ /^if sort /;
    231     return 1 if $line =~ /^    /;
     231    return 1 if $line =~ /^    / && $previousLine !~ /referenced from:$/;
    232232    return 1 if $line =~ /^printf /;
    233233    return 1 if $line =~ /^offlineasm: Nothing changed/;
  • trunk/Tools/Scripts/webkitperl/filter-build-webkit_unittest/shouldIgnoreLine_unittests.pl

    r150285 r150286  
    3535use LoadAsModule qw(FilterBuildWebKit filter-build-webkit);
    3636
     37sub description($);
     38
    3739@FilterBuildWebKit::EXPORT_OK = qw(shouldIgnoreLine);
    3840FilterBuildWebKit->import(@FilterBuildWebKit::EXPORT_OK);
    3941
    40 is(shouldIgnoreLine(""), 1, "empty_line");
    41 is(shouldIgnoreLine(" "), 1, "one_space");
    42 is(shouldIgnoreLine("\t"), 1, "one_tab");
     42#
     43# Test whitespace
     44#
     45is(shouldIgnoreLine("", ""), 1, "Ignored: empty line");
     46is(shouldIgnoreLine("", " "), 1, "Ignored: one space");
     47is(shouldIgnoreLine("", "\t"), 1, "Ignored: one tab");
    4348
     49#
     50# Test input that should be ignored regardless of previous line
     51#
    4452my @expectIgnoredLines = split(/$INPUT_RECORD_SEPARATOR/, <<'END');
    45 Build settings from command line:
    4653make: Nothing to be done for `all'.
    4754JavaScriptCore/create_hash_table JavaScriptCore/runtime/ArrayConstructor.cpp -i > ArrayConstructor.lut.h
     
    5865END
    5966
    60 my $lineLength = 200;
    61 my $ellipsis = "...";
    62 my $truncateLength = $lineLength - length($ellipsis);
    6367for my $line (@expectIgnoredLines) {
    64     my $description = length($line) > $lineLength ? substr($line, 0, $truncateLength) : $line;
    65     $description .= $ellipsis if length($line) != length($description);
    66     is(shouldIgnoreLine($line), 1, $description);
     68    is(shouldIgnoreLine("", $line), 1, description("Ignored: " . $line));
    6769}
    6870
    69 done_testing(3 + scalar(@expectIgnoredLines));
     71#
     72# Test input starting with four spaces
     73#
     74my @buildSettingsLines = split(/$INPUT_RECORD_SEPARATOR/, <<'END');
     75Build settings from command line:
     76    ARCHS = i386 x86_64
     77    OBJROOT = /Volumes/Data/Build
     78    ONLY_ACTIVE_ARCH = NO
     79    SHARED_PRECOMPS_DIR = /Volumes/Data/Build/PrecompiledHeaders
     80    SYMROOT = /Volumes/Data/Build
     81END
     82
     83for my $i (0..scalar(@buildSettingsLines) - 1) {
     84    my $previousLine = $i ? $buildSettingsLines[$i - 1] : "";
     85    my $line = $buildSettingsLines[$i];
     86    is(shouldIgnoreLine($previousLine, $line), 1, description("Ignored: " . $line));
     87}
     88
     89#
     90# Test input for undefined symbols error message
     91#
     92my @undefinedSymbolsLines = split(/$INPUT_RECORD_SEPARATOR/, <<'END');
     93Undefined symbols for architecture x86_64:
     94  "__ZN6WebKit12WebPageProxy28exposedRectChangedTimerFiredEPN7WebCore5TimerIS0_EE", referenced from:
     95      __ZN6WebKit12WebPageProxyC2EPNS_10PageClientEN3WTF10PassRefPtrINS_15WebProcessProxyEEEPNS_12WebPageGroupEy in WebPageProxy.o
     96ld: symbol(s) not found for architecture x86_64
     97clang: error: linker command failed with exit code 1 (use -v to see invocation)
     98END
     99
     100for my $i (0..scalar(@undefinedSymbolsLines) - 1) {
     101    my $previousLine = $i ? $undefinedSymbolsLines[$i - 1] : "";
     102    my $line = $undefinedSymbolsLines[$i];
     103    is(shouldIgnoreLine($previousLine, $line), 0, description("Printed: " . $line));
     104}
     105
     106done_testing();
     107
     108sub description($)
     109{
     110    my ($line) = @_;
     111
     112    my $maxLineLength = 200;
     113    my $ellipsis = "...";
     114    my $truncateLength = $maxLineLength - length($ellipsis);
     115
     116    my $description = length($line) > $maxLineLength ? substr($line, 0, $truncateLength) : $line;
     117    $description .= $ellipsis if length($line) != length($description);
     118
     119    return $description;
     120}
Note: See TracChangeset for help on using the changeset viewer.