@@ -163,7 +163,7 @@ def main():
163
163
Help text and arguments for individual test script:''' ,
164
164
formatter_class = argparse .RawTextHelpFormatter )
165
165
parser .add_argument ('--coverage' , action = 'store_true' , help = 'generate a basic coverage report for the RPC interface' )
166
- parser .add_argument ('--exclude' , '-x' , help = 'specify a comma-seperated-list of scripts to exclude. Do not include the .py extension in the name. ' )
166
+ parser .add_argument ('--exclude' , '-x' , help = 'specify a comma-seperated-list of scripts to exclude.' )
167
167
parser .add_argument ('--extended' , action = 'store_true' , help = 'run the extended test suite in addition to the basic tests' )
168
168
parser .add_argument ('--force' , '-f' , action = 'store_true' , help = 'run tests even on platforms where they are disabled by default (e.g. windows).' )
169
169
parser .add_argument ('--help' , '-h' , '-?' , action = 'store_true' , help = 'print help text and exit' )
@@ -172,8 +172,8 @@ def main():
172
172
parser .add_argument ('--quiet' , '-q' , action = 'store_true' , help = 'only print results summary and failure logs' )
173
173
args , unknown_args = parser .parse_known_args ()
174
174
175
- # Create a set to store arguments and create the passon string
176
- tests = set ( arg for arg in unknown_args if arg [:2 ] != "--" )
175
+ # args to be passed on always start with two dashes; tests are the remaining unknown args
176
+ tests = [ arg for arg in unknown_args if arg [:2 ] != "--" ]
177
177
passon_args = [arg for arg in unknown_args if arg [:2 ] == "--" ]
178
178
179
179
# Read config generated by configure.
@@ -206,8 +206,13 @@ def main():
206
206
if tests :
207
207
# Individual tests have been specified. Run specified tests that exist
208
208
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
209
- test_list = [t for t in ALL_SCRIPTS if
210
- (t in tests or re .sub (".py$" , "" , t ) in tests )]
209
+ tests = [re .sub ("\.py$" , "" , t ) + ".py" for t in tests ]
210
+ test_list = []
211
+ for t in tests :
212
+ if t in ALL_SCRIPTS :
213
+ test_list .append (t )
214
+ else :
215
+ print ("{}WARNING!{} Test '{}' not found in full test list." .format (BOLD [1 ], BOLD [0 ], t ))
211
216
else :
212
217
# No individual tests have been specified.
213
218
# Run all base tests, and optionally run extended tests.
@@ -219,9 +224,12 @@ def main():
219
224
220
225
# Remove the test cases that the user has explicitly asked to exclude.
221
226
if args .exclude :
222
- for exclude_test in args .exclude .split (',' ):
223
- if exclude_test + ".py" in test_list :
224
- test_list .remove (exclude_test + ".py" )
227
+ tests_excl = [re .sub ("\.py$" , "" , t ) + ".py" for t in args .exclude .split (',' )]
228
+ for exclude_test in tests_excl :
229
+ if exclude_test in test_list :
230
+ test_list .remove (exclude_test )
231
+ else :
232
+ print ("{}WARNING!{} Test '{}' not found in current test list." .format (BOLD [1 ], BOLD [0 ], exclude_test ))
225
233
226
234
if not test_list :
227
235
print ("No valid test scripts specified. Check that your test is in one "
0 commit comments