Changeset 208413 in webkit


Ignore:
Timestamp:
Nov 4, 2016 7:48:16 PM (7 years ago)
Author:
jfbastien@apple.com
Message:

testWASM should be very sad if no options are provided
https://bugs.webkit.org/show_bug.cgi?id=164444

Reviewed by Saam Barati.

Detect missing or invalid options on the command line.

  • testWasm.cpp:

(CommandLine::parseArguments):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r208410 r208413  
     12016-11-04  JF Bastien  <jfbastien@apple.com>
     2
     3        testWASM should be very sad if no options are provided
     4        https://bugs.webkit.org/show_bug.cgi?id=164444
     5
     6        Reviewed by Saam Barati.
     7
     8        Detect missing or invalid options on the command line.
     9
     10        * testWasm.cpp:
     11        (CommandLine::parseArguments):
     12
    1132016-11-04  Mark Lam  <mark.lam@apple.com>
    214
  • trunk/Source/JavaScriptCore/testWasm.cpp

    r208402 r208413  
    4747    }
    4848
    49     Vector<String> m_arguments;
    5049    bool m_runLEBTests { false };
    5150    bool m_runWasmTests { false };
     
    6968    int i = 1;
    7069
     70    if (argc == i)
     71        printUsageStatement(false);
     72
    7173    for (; i < argc; ++i) {
    7274        const char* arg = argv[i];
    73         if (!strcmp(arg, "-h") || !strcmp(arg, "--help"))
     75
     76        if (!strcmp(arg, "-h") || !strcmp(arg, "--help")) {
    7477            printUsageStatement(true);
    75 
    76         if (!strcmp(arg, "-l") || !strcmp(arg, "--leb"))
     78            RELEASE_ASSERT_NOT_REACHED();
     79        }
     80
     81        if (!strcmp(arg, "-l") || !strcmp(arg, "--leb")) {
    7782            m_runLEBTests = true;
    78 
    79         if (!strcmp(arg, "-w") || !strcmp(arg, "--web"))
     83            continue;
     84        }
     85
     86        if (!strcmp(arg, "-w") || !strcmp(arg, "--web")) {
    8087            m_runWasmTests = true;
    81     }
    82 
    83     for (; i < argc; ++i)
    84         m_arguments.append(argv[i]);
    85 
     88            continue;
     89        }
     90
     91        fprintf(stderr, "Unknown option %s\n", arg);
     92        printUsageStatement(false);
     93    }
    8694}
    8795
Note: See TracChangeset for help on using the changeset viewer.