Title: [273883] trunk/Tools
Revision
273883
Author
commit-qu...@webkit.org
Date
2021-03-04 05:01:00 -0800 (Thu, 04 Mar 2021)

Log Message

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

Patch by Angelos Oikonomopoulos <ange...@igalia.com> on 2021-03-04
Reviewed by Keith Miller.

run-_javascript_core-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-_javascript_core-tests:

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (273882 => 273883)


--- trunk/Tools/ChangeLog	2021-03-04 11:26:43 UTC (rev 273882)
+++ trunk/Tools/ChangeLog	2021-03-04 13:01:00 UTC (rev 273883)
@@ -1,3 +1,21 @@
+2021-03-04  Angelos Oikonomopoulos  <ange...@igalia.com>
+
+        Detect unrecognized options in run-_javascript_core-tests
+        https://bugs.webkit.org/show_bug.cgi?id=221186
+
+        Reviewed by Keith Miller.
+
+        run-_javascript_core-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-_javascript_core-tests:
+
 2021-03-04  Kimmo Kinnunen  <kkinnu...@apple.com>
 
         Adding new test conditions for WebGL should be simpler

Modified: trunk/Tools/Scripts/run-_javascript_core-tests (273882 => 273883)


--- trunk/Tools/Scripts/run-_javascript_core-tests	2021-03-04 11:26:43 UTC (rev 273882)
+++ trunk/Tools/Scripts/run-_javascript_core-tests	2021-03-04 13:01:00 UTC (rev 273883)
@@ -484,9 +484,23 @@
 $runJSCStress = enableTestOrNot($runJSCStress);
 $runMozillaTests = enableTestOrNot($runMozillaTests);
 
-# Assume any arguments left over from GetOptions are assumed to be build arguments
-my @buildArgs = @ARGV;
+my @buildArgs;
 
+if ($buildJSC) {
+    # Assume any arguments left over from GetOptions are to be passed as build arguments.
+    @buildArgs = @ARGV;
+} elsif (scalar(@ARGV) > 0) {
+    foreach (@ARGV) {
+        my $arg = $_;
+        if ($arg =~ /^-.*/) {
+            print STDERR "Unrecognized option `$arg'\n";
+        } else {
+            print STDERR "Stray anonymous argument `$arg'\n";
+        }
+    }
+    exit 2;
+}
+
 if ($showHelp) {
    print STDERR $usage;
    exit 1;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to