⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 273307 in webkit


Ignore:
Timestamp:
Feb 23, 2021, 8:18:08 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Detect unrecognized options in run-javascriptcore-tests
​https://bugs.webkit.org/show_bug.cgi?id=221186

Patch by Angelos Oikonomopoulos <Angelos Oikonomopoulos> on 2021-02-23
Reviewed by Keith Miller.

run-javascriptcore-tests saves unrecognized arguments to pass
through to build-jsc even when --no-build is used. However, when
we're not building, nothing will ever use or look at the extra
arguments. This means that those arguments are silently eaten
up and, consequently, typos in option names can go undetected.

Change the script to fail when --no-build has been passed and
there are unrecognized options.

  • Scripts/run-javascriptcore-tests:
Location:
trunk/Tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r273303 r273307  
     12021-02-23  Angelos Oikonomopoulos  <angelos@igalia.com>
     2
     3        Detect unrecognized options in run-javascriptcore-tests
     4        https://bugs.webkit.org/show_bug.cgi?id=221186
     5
     6        Reviewed by Keith Miller.
     7
     8        run-javascriptcore-tests saves unrecognized arguments to pass
     9        through to build-jsc even when --no-build is used. However, when
     10        we're not building, nothing will ever use or look at the extra
     11        arguments. This means that those arguments are silently eaten
     12        up and, consequently, typos in option names can go undetected.
     13
     14        Change the script to fail when --no-build has been passed and
     15        there are unrecognized options.
     16
     17        * Scripts/run-javascriptcore-tests:
     18
    1192021-02-23  Frederic Wang  <fwang@igalia.com>
    220
  • trunk/Tools/Scripts/run-javascriptcore-tests

    r272056 r273307  
    485485$runMozillaTests = enableTestOrNot($runMozillaTests);
    486486
    487 # Assume any arguments left over from GetOptions are assumed to be build arguments
    488 my @buildArgs = @ARGV;
     487my @buildArgs;
     488
     489if ($buildJSC) {
     490    # Assume any arguments left over from GetOptions are to be passed as build arguments.
     491    @buildArgs = @ARGV;
     492} elsif (scalar(@ARGV) > 0) {
     493    foreach (@ARGV) {
     494        my $arg = $_;
     495        if ($arg =~ /^-.*/) {
     496            print STDERR "Unrecognized option `$arg'\n";
     497        } else {
     498            print STDERR "Stray anonymous argument `$arg'\n";
     499        }
     500    }
     501    exit 2;
     502}
    489503
    490504if ($showHelp) {
Note: See TracChangeset for help on using the changeset viewer.