Run all tests if have no specified tests

This commit is contained in:
Lzu Tao 2020-07-31 04:20:27 +00:00
parent c058a8b8dc
commit a4757225d7
1 changed files with 5 additions and 3 deletions

View File

@ -193,10 +193,12 @@ def interact(proc, queue):
def main():
global MAILBOX
tests = [os.path.splitext(f)[0] for f in glob('*.rs')
if not f.startswith('_')]
all_tests = [os.path.splitext(f)[0] for f in glob('*.rs') if not f.startswith('_')]
args = sys.argv[1:]
tests = [test for test in tests if test in args]
if args:
tests = [test for test in all_tests if test in args]
else
tests = all_tests
if not tests:
print("Error: No tests to run")
sys.exit(1)