Skip to content

Commit

Permalink
abstract path unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshgoebel committed May 31, 2021
1 parent 6ea6678 commit 745981c
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions util/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,14 +405,22 @@ def run_example(path):

run_script(WREN_APP, path, "example")

def run_unit(path):
global passed
global failed

if (splitext(path)[1] != '.wren'):
return

err = os.system(f"{WREN_APP} {path}")
if (err!=0):
failed += 1
else:
passed += 1

walk(join(WREN_DIR, 'test'), run_test)
walk(join(WREN_DIR, 'example'), run_example)
err = os.system("./bin/wrenc test/unit/path_test.wren")
if (err!=0):
failed += 1
else:
passed += 1
walk(join(WREN_DIR, 'test/unit'), run_unit)

print_line()
if failed == 0:
Expand Down

0 comments on commit 745981c

Please sign in to comment.