diff options
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py index f45b85e0..0d6df070 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -355,7 +355,6 @@ if 'benchmark' not in str(sys.argv) and 'sanity' not in str(sys.argv) and 'brows js_engines = filter(lambda engine: engine not in self.banned_js_engines, js_engines) if len(js_engines) == 0: return self.skip('No JS engine present to run this test with. Check %s and settings.py and the paths therein.' % EM_CONFIG) for engine in js_engines: - engine = filter(lambda arg: arg != '-n', engine) # SpiderMonkey issue 716255 js_output = self.run_generated_code(engine, filename + '.o.js', args) if output_nicerizer is not None: js_output = output_nicerizer(js_output) @@ -7214,10 +7213,22 @@ elif 'browser' in str(sys.argv): Popen(['python', EMCC, program, '-o', 'program.html', '--pre-js', 'reftest.js'] + args).communicate() self.run_browser('program.html', '', '/report_result?0') + def btest(self, filename, expected=None, reference=None, args=[]): # TODO: use in all other tests + if not reference: + open(os.path.join(self.get_dir(), filename), 'w').write(self.with_report_result(open(path_from_root('tests', filename)).read())) + else: + expected = '0' # 0 pixels difference than reference + shutil.copyfile(path_from_root('tests', filename), os.path.join(self.get_dir(), filename)) + self.reftest(path_from_root('tests', reference)) + args += ['--pre-js', 'reftest.js'] + Popen(['python', EMCC, os.path.join(self.get_dir(), filename), '-o', 'test.html'] + args).communicate() + self.run_browser('test.html', '.', '/report_result?' + expected) + def test_emscripten_api(self): - open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(self.with_report_result(open(path_from_root('tests', 'emscripten_api_browser.cpp')).read())) - Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '-o', 'page.html']).communicate() - self.run_browser('page.html', '', '/report_result?1') + self.btest('emscripten_api_browser.cpp', '1') + + def test_sdlglshader(self): + self.btest('sdlglshader.c', reference='sdlglshader.png') elif 'benchmark' in str(sys.argv): # Benchmarks. Run them with argument |benchmark|. To run a specific test, do |