diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-11-13 11:27:22 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-11-13 11:27:22 -0800 |
commit | 8263e2377f6cbbb88523aefeb86123e1a6887f1a (patch) | |
tree | 044cacf306add04577df3c490649fb94ac4390c7 /tests/runner.py | |
parent | eb6144f24f3379b6de5e59a3811dcaa1514c2b00 (diff) |
headless option
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index 7fc2f284..62e1b7e1 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -8323,6 +8323,18 @@ fscanfed: 10 - hello Popen(['python', FILE_PACKAGER, 'test.data', '--pre-run', '--crunch=32', '--preload', 'ship.dds'], stdout=open('pre.js', 'w')).communicate() assert crunch_time < os.stat('ship.crn').st_mtime, 'Crunch was changed' + def test_headless(self): + shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'example.png')) + Popen(['python', EMCC, path_from_root('tests', 'sdl_canvas.c'), '-s', 'HEADLESS=1']).communicate() + output = run_js('a.out.js', engine=SPIDERMONKEY_ENGINE, stderr=PIPE) + assert '''Init: 0 +Font: 0x1 +Sum: 0 +you should see two lines of text in different colors and a blue rectangle +SDL_Quit called (and ignored) +done. +''' in output, output + elif 'browser' in str(sys.argv): # Browser tests. |