@@ -1985,7 +1985,6 @@ int main(int argc, char **argv)
1985
1985
BOOL is_dir_list ;
1986
1986
BOOL only_check_errors = FALSE;
1987
1987
const char * filename ;
1988
- const char * config = NULL ;
1989
1988
const char * ignore = "" ;
1990
1989
BOOL is_test262_harness = FALSE;
1991
1990
BOOL is_module = FALSE;
@@ -1996,6 +1995,18 @@ int main(int argc, char **argv)
1996
1995
setenv ("TZ" , "America/Los_Angeles" , 1 );
1997
1996
#endif
1998
1997
1998
+ optind = 1 ;
1999
+ while (optind < argc ) {
2000
+ char * arg = argv [optind ];
2001
+ if (* arg != '-' )
2002
+ break ;
2003
+ optind ++ ;
2004
+ if (strstr ("-c -d -e -x -f -r -E -T" , arg ))
2005
+ optind ++ ;
2006
+ if (strstr ("-d -f" , arg ))
2007
+ ignore = "testdir" ; // run only the tests from -d or -f
2008
+ }
2009
+
1999
2010
/* cannot use getopt because we want to pass the command line to
2000
2011
the script */
2001
2012
optind = 1 ;
@@ -2020,16 +2031,14 @@ int main(int argc, char **argv)
2020
2031
} else if (str_equal (arg , "-v" )) {
2021
2032
verbose ++ ;
2022
2033
} else if (str_equal (arg , "-c" )) {
2023
- config = get_opt_arg (arg , argv [optind ++ ]);
2034
+ load_config ( get_opt_arg (arg , argv [optind ++ ]), ignore );
2024
2035
} else if (str_equal (arg , "-d" )) {
2025
- ignore = "testdir" ; // don't run all tests, just the ones from -d
2026
2036
enumerate_tests (get_opt_arg (arg , argv [optind ++ ]));
2027
2037
} else if (str_equal (arg , "-e" )) {
2028
2038
error_filename = get_opt_arg (arg , argv [optind ++ ]);
2029
2039
} else if (str_equal (arg , "-x" )) {
2030
2040
namelist_load (& exclude_list , get_opt_arg (arg , argv [optind ++ ]));
2031
2041
} else if (str_equal (arg , "-f" )) {
2032
- ignore = "testdir" ; // don't run all tests, just the one from -f
2033
2042
is_dir_list = FALSE;
2034
2043
} else if (str_equal (arg , "-r" )) {
2035
2044
report_filename = get_opt_arg (arg , argv [optind ++ ]);
@@ -2047,9 +2056,6 @@ int main(int argc, char **argv)
2047
2056
}
2048
2057
}
2049
2058
2050
- if (config )
2051
- load_config (config , ignore );
2052
-
2053
2059
if (optind >= argc && !test_list .count )
2054
2060
help ();
2055
2061
0 commit comments