aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-04-23 17:52:20 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-04-23 17:52:20 -0700
commit28ed391308c78e8cda92bfbe22da88ce9767cd25 (patch)
tree41fde9dc11818abd67b836b054f90dc47cffdd0e /tests/test_core.py
parent55c1dfd2c1548ebfd023e4f7d1c2416a11a534f8 (diff)
webidl binder
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 1b116c4a..b5024309 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -5971,6 +5971,22 @@ def process(filename):
'''
self.do_run(src, '|hello|43|world|41|', post_build=post)
+ def test_webidl(self):
+ if self.emcc_args is None: return self.skip('requires emcc')
+
+ output = Popen([PYTHON, path_from_root('tools', 'webidl_binder.py'),
+ path_from_root('tests', 'webidl', 'test.idl'),
+ 'glue']).communicate()[0]
+ assert os.path.exists('glue.cpp')
+ assert os.path.exists('glue.js')
+
+ self.emcc_args += ['--post-js', 'glue.js',
+ '--post-js', path_from_root('tests', 'webidl', 'post.js')]
+ shutil.copyfile(path_from_root('tests', 'webidl', 'test.h'), self.in_dir('test.h'))
+ shutil.copyfile(path_from_root('tests', 'webidl', 'test.cpp'), self.in_dir('test.cpp'))
+ src = open('test.cpp').read()
+ self.do_run(src, open(path_from_root('tests', 'webidl', 'output.txt')).read())
+
def test_typeinfo(self):
if os.environ.get('EMCC_FAST_COMPILER') != '0': return self.skip('fastcomp does not support RUNTIME_TYPE_INFO')