diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-08-30 14:49:12 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-08-30 14:49:12 -0700 |
commit | 249e75b46f07ebca6cce1b648b5d34bc4a75792c (patch) | |
tree | ef2889dc90b6347d7e9d58f6c46f678e302af5ec /tests/runner.py | |
parent | 2a193932e89d6371913d6fdcbb55a072508a8140 (diff) |
support for SDL_QUIT event
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/tests/runner.py b/tests/runner.py index 72eb2e7c..ec2f290f 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -7649,15 +7649,17 @@ elif 'browser' in str(sys.argv): print '(moving on..)' def with_report_result(self, code): - return code.replace('REPORT_RESULT();', ''' - char output[1000]; - sprintf(output, - "xhr = new XMLHttpRequest();" - "xhr.open('GET', 'http://localhost:8888/report_result?%d');" - "xhr.send();", result); - emscripten_run_script(output); + return ''' + #define REPORT_RESULT_INTERNAL(sync) \ + char output[1000]; \ + sprintf(output, \ + "xhr = new XMLHttpRequest();" \ + "xhr.open('GET', 'http://localhost:8888/report_result?%d'%s);" \ + "xhr.send();", result, sync ? ", false" : ""); \ + emscripten_run_script(output); \ emscripten_run_script("setTimeout(function() { window.close() }, 1000)"); -''') + #define REPORT_RESULT() REPORT_RESULT_INTERNAL(0) +''' + code def reftest(self, expected): basename = os.path.basename(expected) @@ -8157,6 +8159,9 @@ elif 'browser' in str(sys.argv): shutil.copyfile(path_from_root('tests', 'screenshot.png'), os.path.join(self.get_dir(), 'screenshot.png')) # preloaded *after* run self.btest('emscripten_fs_api_browser.cpp', '1') + def test_sdl_quit(self): + self.btest('sdl_quit.c', '1') + def test_gc(self): self.btest('browser_gc.cpp', '1') |