From 5ad94fb4da472624d24be1dbbd3a25802351f3e5 Mon Sep 17 00:00:00 2001 From: Kyle Marek-Spartz Date: Thu, 21 May 2015 09:17:40 -0500 Subject: [PATCH] Add ignored to walk() in test.py to clean up list of test dirs. --- script/test.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/script/test.py b/script/test.py index 302b8f80..134a5de8 100755 --- a/script/test.py +++ b/script/test.py @@ -44,10 +44,17 @@ skipped = defaultdict(int) num_skipped = 0 -def walk(dir, callback): - """ Walks [dir], and executes [callback] on each file. """ +def walk(dir, callback, ignored=None): + """ + Walks [dir], and executes [callback] on each file unless it is [ignored]. + """ + + if not ignored: + ignored = [] + ignored += [".",".."] + dir = abspath(dir) - for file in [file for file in listdir(dir) if not file in [".",".."]]: + for file in [file for file in listdir(dir) if not file in ignored]: nfile = join(dir, file) if isdir(nfile): walk(nfile, callback) @@ -247,11 +254,8 @@ def run_test(path, example=False): def run_example(path): return run_test(path, example=True) -for dir in ['core', 'io', 'language', 'limit', 'meta']: - walk(join(WREN_DIR, 'test', dir), run_test) - +walk(join(WREN_DIR, 'test'), run_test, ignored=['benchmark']) walk(join(WREN_DIR, 'example'), run_example) -walk(join(WREN_DIR, 'example', 'import-module'), run_example) print_line() if failed == 0: