Changeset 30795 in webkit for trunk/JavaScriptCore/API/testapi.c


Ignore:
Timestamp:
Mar 5, 2008, 10:19:12 AM (17 years ago)
Author:
[email protected]
Message:

Allow override of default script file name using command-line argument.

Reviewed by Adele.

  • API/minidom.c: (main): Allow first command-line argument to override the default script file name of "minidom.js".
  • API/testapi.c: (main): Allow first command-line argument to override the default script file name of "testapi.js".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/API/testapi.c

    r29672 r30795  
    540540int main(int argc, char* argv[])
    541541{
    542     UNUSED_PARAM(argc);
    543     UNUSED_PARAM(argv);
     542    const char *scriptPath = "testapi.js";
     543    if (argc > 1) {
     544        scriptPath = argv[1];
     545    }
    544546   
    545547    // Test garbage collection with a fresh context
     
    869871    ASSERT(JSValueIsEqual(context, v, o, NULL));
    870872   
    871     char* scriptUTF8 = createStringWithContentsOfFile("testapi.js");
     873    char* scriptUTF8 = createStringWithContentsOfFile(scriptPath);
    872874    if (!scriptUTF8)
    873875        printf("FAIL: Test script could not be loaded.\n");
Note: See TracChangeset for help on using the changeset viewer.