aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rw-r--r--tests/runner.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 2a988f8c..d35afa86 100644
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -99,11 +99,10 @@ class RunnerCore(unittest.TestCase):
if 'benchmark' not in sys.argv:
class T(RunnerCore): # Short name, to make it more fun to use manually on the commandline
## Does a complete test - builds, runs, checks output, etc.
- def do_test(self, src, expected_output, args=[], output_nicerizer=None, output_processor=None, no_build=False, main_file=None, js_engines=None, post_build=None):
- if not no_build:
- print 'Running test:', inspect.stack()[1][3].replace('test_', ''), '[%s%s]' % (COMPILER.split(os.sep)[-1], ',reloop&optimize' if RELOOP else '')
+ def do_test(self, src, expected_output, args=[], output_nicerizer=None, output_processor=None, no_build=False, main_file=None, js_engines=None, post_build=None, basename='src.cpp'):
+ print 'Running test:', inspect.stack()[1][3].replace('test_', ''), '[%s%s]' % (COMPILER.split(os.sep)[-1], ',reloop&optimize' if RELOOP else '')
dirname = self.get_dir()
- filename = os.path.join(dirname, 'src.cpp')
+ filename = os.path.join(dirname, basename)
if not no_build:
self.build(src, dirname, filename, main_file=main_file)
@@ -1020,6 +1019,16 @@ if 'benchmark' not in sys.argv:
no_build=True,
js_engines=[V8_ENGINE]) # mozilla bug XXX
+ ### Test cases in separate files
+
+ def test_cases(self):
+ for name in os.listdir(path_from_root(['tests', 'cases'])):
+ shortname = name.replace('.ll', '')
+ filename = os.path.join(self.get_dir(), shortname)
+ shutil.copy(path_from_root(['tests', 'cases', name]), filename+'.o.ll')
+ self.do_emscripten(filename)
+ self.do_test(None, 'hello, world!', no_build=True, basename=shortname)
+
### Integration tests
def test_scriptaclass(self):