VirtualBox

Changeset 1966

Show
Ignore:
Timestamp:
04/06/07 08:15:20 (2 years ago)
Author:
vboxsync
Message:

Take an argument.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/testcase/tstRunTestcases.cpp

    r1202 r1966  
    248248{ 
    249249    RTR3Init(false, 0); 
    250     Process("testcase/tst*", "testcase"); 
    251     Process("tst*", "."); 
     250 
     251    if (argc == 1) 
     252    { 
     253        Process("testcase/tst*", "testcase"); 
     254        Process("tst*", "."); 
     255    } 
     256    else 
     257    { 
     258        char szDir[RTPATH_MAX]; 
     259        for (int i = 1; i < argc; i++) 
     260        { 
     261            if (argv[i][0] == '-') 
     262            { 
     263                switch (argv[i][1]) 
     264                { 
     265                    /* case '':... */ 
     266 
     267                    default: 
     268                        RTPrintf("syntax error: Option '%s' is not recognized\n", argv[i]); 
     269                        return 1; 
     270                } 
     271            } 
     272            else 
     273            { 
     274                size_t cch = strlen(argv[i]); 
     275                if (cch >= sizeof(szDir)) 
     276                { 
     277                    RTPrintf("syntax error: '%s' is too long!\n", argv[i]); 
     278                    return 1; 
     279                } 
     280                memcpy(szDir, argv[i], cch + 1); 
     281                char *pszFilename = RTPathFilename(szDir); 
     282                if (!pszFilename) 
     283                { 
     284                    RTPrintf("syntax error: '%s' does not include a file name or file name mask!\n", argv[i]); 
     285                    return 1; 
     286                } 
     287                RTPathStripFilename(szDir); 
     288                Process(argv[i], szDir); 
     289            } 
     290        } 
     291    } 
    252292 
    253293    RTPrintf("\n" 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy