Commit af9a4c83 authored by Yijie Deng's avatar Yijie Deng
Browse files

Merge branch 'main' of gitlab.cs.washington.edu:cse490x-22sp/cse490x-22sp-tests into main

parents 83ccd900 0e02af91
......@@ -9,6 +9,18 @@ HTML tags. This file contains tests for the additional functionality.
>>> _ = test.ssl.patch().start()
>>> import browser
Make sure you have the expected default values for `HSTEP`, `VSTEP`,
`WIDTH`, and `HEIGHT`.
>>> browser.HSTEP
13
>>> browser.VSTEP
18
>>> browser.WIDTH
800
>>> browser.HEIGHT
600
Testing `lex`
-------------
......
......@@ -80,13 +80,14 @@ specific_file_tests = {}
add option to run all tests by running script w/ argval 'all',
and add option to run individual test files by name (removing '-exercise-' infix substring if present)
'''
for tests in CURRENT_TESTS.values():
for chapterkey, tests in CURRENT_TESTS.items():
all_tests.extend(tests)
for test in tests:
for i, test in enumerate(tests):
arg_val = re.sub(r'-exercise', '', test)
arg_val = re.sub(r'-tests.md', '', arg_val)
specific_file_tests[arg_val] = [test]
specific_file_tests[chapterkey + '-' + str(i + 1)] = [test]
CURRENT_TESTS["all"] = all_tests
......@@ -198,16 +199,26 @@ def parse_arguments(argv):
parser = argparse.ArgumentParser(description='WBE test runner')
parser.add_argument("chapter",
nargs="?",
default="chapter10",
default="chapter3",
choices=list(CURRENT_TESTS),
help="Which chapter's tests to run")
parser.add_argument("--index",
type=int,
help="Run the nth test from the chapter. "
"(Requires passing a full chapter name.)")
args = parser.parse_args(argv[1:])
return args
def main(argv):
args = parse_arguments(argv)
tests = CURRENT_TESTS[args.chapter]
testkey = args.chapter
if args.index is not None:
assert args.chapter.startswith("chapter")
testkey = args.chapter + "-" + str(args.index)
tests = CURRENT_TESTS[testkey]
mapped_results = run_doctests(tests)
total_state = "all passed"
print("\nSummarised results\n")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment