aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-03-12 10:47:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-03-12 10:47:35 -0700
commit68988a8603205375341db691db5f843f4080b39a (patch)
tree11db96725b9b3e503e086497cc59519ecd0ed2c0 /tests/runner.py
parent74fc756d57064a7bfa1e69ff6bfe2f1c687be3ae (diff)
support -s KEY=@PATH in emcc, for very large settings values
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index e5e12b1e..df6c338e 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -7758,17 +7758,28 @@ def process(filename):
self.emcc_args = map(lambda x: 'ASM_JS=1' if x == 'ASM_JS=0' else x, self.emcc_args)
shutil.move(self.in_dir('src.cpp.o.js'), self.in_dir('pgo.js'))
- pgo_output = run_js(self.in_dir('pgo.js'))
+ pgo_output = run_js(self.in_dir('pgo.js')).split('\n')[1]
+ open('pgo_data', 'w').write(pgo_output)
+
+ # with response file
- open('pgo_data', 'w').write(pgo_output.split('\n')[1])
self.emcc_args += ['@pgo_data']
self.do_run(src, output)
+ self.emcc_args.pop()
shutil.move(self.in_dir('src.cpp.o.js'), self.in_dir('pgoed.js'))
before = len(open('normal.js').read())
after = len(open('pgoed.js').read())
assert after < 0.66 * before, [before, after] # expect a big size reduction
+ # with response in settings element itself
+
+ open('dead_funcs', 'w').write(pgo_output[pgo_output.find('['):-1])
+ self.emcc_args += ['-s', 'DEAD_FUNCTIONS=@' + self.in_dir('dead_funcs')]
+ self.do_run(src, output)
+ shutil.move(self.in_dir('src.cpp.o.js'), self.in_dir('pgoed2.js'))
+ assert open('pgoed.js').read() == open('pgoed2.js').read()
+
def test_scriptaclass(self):
if self.emcc_args is None: return self.skip('requires emcc')
if Settings.ASM_JS: return self.skip('asm does not bindings generator yet')