diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-04-22 17:25:01 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-04-22 17:25:01 -0700 |
commit | 226602659376783e74be820f55cf1b1f2f4608fb (patch) | |
tree | 63505a6e289e731dc5d3347d2445f3272ee87ab7 /tests | |
parent | 2ecdc770ee8ebda65400ec550a0d50dad111af7e (diff) |
optional debug saving of generated js in test runner
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runner.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 2dbf4eb2..b6fc6730 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -33,9 +33,20 @@ AUTODEBUGGER = path_from_root('tools', 'autodebugger.py') GlobalCache = {} +class Dummy: pass +Settings = Dummy() +Settings.saveJS = False + # Core test runner class, shared between normal tests and benchmarks class RunnerCore(unittest.TestCase): + def tearDown(self): + if Settings.saveJS: + for name in os.listdir(self.get_dir()): + if name[-3:] == '.js': + shutil.copy(os.path.join(self.get_dir(), name), + os.path.join(TEMP_DIR, self.id().replace('__main__.', '').replace('.test_', '.')+'.js')) + def skip(self): print >> sys.stderr, '<skip> ', |