diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 19:55:09 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-05-01 19:55:09 -0700 |
commit | cc6763ec4ebab535ade9edeb932c9d90c070ac4e (patch) | |
tree | b32010347fda33e45cde6098555c71f4f9166703 /tests/runner.py | |
parent | f54612a210af5c85071d54d892d533656a940c7c (diff) |
undef __linux__, fixes SDL endianness detection
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-x | tests/runner.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/runner.py b/tests/runner.py index a5b5ad84..69f996ca 100755 --- a/tests/runner.py +++ b/tests/runner.py @@ -6612,6 +6612,19 @@ f.close() Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp'), '--pre-js', 'before.js', '--post-js', 'after.js']).communicate() self.assertContained('hello from main\nhello from js\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_sdl_endianness(self): + open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(r''' + #include <stdio.h> + #include <SDL/SDL.h> + + int main() { + printf("%d, %d, %d\n", SDL_BYTEORDER, SDL_LIL_ENDIAN, SDL_BIG_ENDIAN); + return 0; + } + ''') + Popen(['python', EMCC, os.path.join(self.get_dir(), 'main.cpp')]).communicate() + self.assertContained('1234, 1234, 4321\n', run_js(os.path.join(self.get_dir(), 'a.out.js'))) + def test_prepost(self): open(os.path.join(self.get_dir(), 'main.cpp'), 'w').write(''' #include <stdio.h> |