def run_tests(program_args, use_shell): for i, test in enumerate(extract.tests()): program = spawn(program_args, use_shell) opcodes = parse_test(test.lines) print("Running test %d: %s" % (i + 1, test.name)) try: run_test(program, opcodes) print("Test %d passed" % (i + 1)) except (TimeoutFailure, TestFailure) as e: print("Test %d failed: %s" % (i + 1, e)) break print("\n") # add 2 blank lines between tests