@@ -133,6 +133,7 @@ def main():
133
133
Help text and arguments for individual test script:''' ,
134
134
formatter_class = argparse .RawTextHelpFormatter )
135
135
parser .add_argument ('--coverage' , action = 'store_true' , help = 'generate a basic coverage report for the RPC interface' )
136
+ parser .add_argument ('--exclude' , '-x' , help = 'specify a comma-seperated-list of scripts to exclude. Do not include the .py extension in the name.' )
136
137
parser .add_argument ('--extended' , action = 'store_true' , help = 'run the extended test suite in addition to the basic tests' )
137
138
parser .add_argument ('--force' , '-f' , action = 'store_true' , help = 'run tests even on platforms where they are disabled by default (e.g. windows).' )
138
139
parser .add_argument ('--help' , '-h' , '-?' , action = 'store_true' , help = 'print help text and exit' )
@@ -179,13 +180,6 @@ def main():
179
180
# in the ALL_SCRIPTS list. Accept the name with or without .py extension.
180
181
test_list = [t for t in ALL_SCRIPTS if
181
182
(t in tests or re .sub (".py$" , "" , t ) in tests )]
182
- if not test_list :
183
- print ("No valid test scripts specified. Check that your test is in one "
184
- "of the test lists in rpc-tests.py or run rpc-tests.py with no arguments to run all tests" )
185
- print ("Scripts not found:" )
186
- print (tests )
187
- sys .exit (0 )
188
-
189
183
else :
190
184
# No individual tests have been specified. Run base tests, and
191
185
# optionally ZMQ tests and extended tests.
@@ -198,6 +192,17 @@ def main():
198
192
# (for parallel running efficiency). This combined list will is no
199
193
# longer sorted.
200
194
195
+ # Remove the test cases that the user has explicitly asked to exclude.
196
+ if args .exclude :
197
+ for exclude_test in args .exclude .split (',' ):
198
+ if exclude_test + ".py" in test_list :
199
+ test_list .remove (exclude_test + ".py" )
200
+
201
+ if not test_list :
202
+ print ("No valid test scripts specified. Check that your test is in one "
203
+ "of the test lists in rpc-tests.py, or run rpc-tests.py with no arguments to run all tests" )
204
+ sys .exit (0 )
205
+
201
206
if args .help :
202
207
# Print help for rpc-tests.py, then print help of the first script and exit.
203
208
parser .print_help ()
0 commit comments