aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2012-03-19 15:48:21 -0700
committerAlon Zakai <alonzakai@gmail.com>2012-03-19 15:48:21 -0700
commit3bb37508dbb4a05a51c952bb39dfd454c615ecef (patch)
treedaff3eddb0f57d9b7fef45b91948281b78346a91
parente4a926f49b3eb2ff5b7f170e3efe931c3fcde415 (diff)
remove .compress if the compress wasn't worth it
-rwxr-xr-xemcc3
-rwxr-xr-xtests/runner.py1
2 files changed, 4 insertions, 0 deletions
diff --git a/emcc b/emcc
index fb07dfea..e3829567 100755
--- a/emcc
+++ b/emcc
@@ -832,6 +832,9 @@ try:
os.stat(Compression.compressed_name(file_['name'])).st_size):
file_['net_name'] = Compression.compressed_name(file_['name'])
file_['compressed'] = True
+ else:
+ if DEBUG: print >> sys.stderr, 'emcc: not compressing %s since not worth it' % file_['name']
+ os.remove(Compression.compressed_name(file_['name']))
# Set up folders
partial_dirs = []
diff --git a/tests/runner.py b/tests/runner.py
index 80baf7fd..5f06d255 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -6357,6 +6357,7 @@ f.close()
path_from_root('third_party', 'lzma.js', 'lzma-decoder.js'),
'LZMA.decompress')]).communicate()
assert ('.compress' in open('page.js').read()) == worth_compressing, 'do not compress image if not worth it'
+ assert os.path.exists(basename + '.compress') == worth_compressing, 'remove .compress if not compressing'
if worth_compressing:
shutil.move(os.path.join(self.get_dir(), basename), basename + '.renamedsoitcannotbefound');
self.run_browser('page.html', '', '/report_result?' + str(width))