aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rwxr-xr-xtests/runner.py8
-rw-r--r--tools/file_packager.py21
3 files changed, 20 insertions, 10 deletions
diff --git a/AUTHORS b/AUTHORS
index 021240e2..9ff060e7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -88,3 +88,4 @@ a license to everyone to use it as detailed in LICENSE.)
* Joseph Gentle <me@josephg.com>
* Douglas T. Crosher <dtc-moz@scieneer.com> (copyright owned by Mozilla Founcation)
* Soeren Balko <soeren.balko@gmail.com>
+* Ryan Kelly (ryan@rfk.id.au)
diff --git a/tests/runner.py b/tests/runner.py
index 339ce68c..48144ecb 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10024,6 +10024,11 @@ finalizing 3 (global == 0)
for k, v in self.env.iteritems():
del os.environ[k]
+ # clear global changes to Building
+ Building.COMPILER_TEST_OPTS = []
+ Building.COMPILER = CLANG
+ Building.LLVM_OPTS = 0
+
TT.tearDown = tearDown
def setUp(self):
@@ -12810,8 +12815,9 @@ Press any key to continue.'''
self.run_browser('page.html', 'Should print "(300, 150)" -- the size of the canvas in pixels', '/report_result?1')
def test_freealut(self):
- programs = self.get_library('freealut', os.path.join('examples', 'hello_world.bc'), make_args=['EXEEXT=.bc'])
+ programs = self.get_library('freealut', os.path.join('examples', '.libs', 'hello_world.bc'), make_args=['EXEEXT=.bc'])
for program in programs:
+ assert os.path.exists(program)
Popen([PYTHON, EMCC, '-O2', program, '-o', 'page.html']).communicate()
self.run_browser('page.html', 'You should hear "Hello World!"')
diff --git a/tools/file_packager.py b/tools/file_packager.py
index cc030f59..575e5957 100644
--- a/tools/file_packager.py
+++ b/tools/file_packager.py
@@ -330,15 +330,18 @@ for file_ in data_files:
if file_['mode'] == 'embed':
# Embed
data = map(ord, open(file_['srcpath'], 'rb').read())
- str_data = ''
- chunk_size = 10240
- while len(data) > 0:
- chunk = data[:chunk_size]
- data = data[chunk_size:]
- if not str_data:
- str_data = str(chunk)
- else:
- str_data += '.concat(' + str(chunk) + ')'
+ if not data:
+ str_data = '[]'
+ else:
+ str_data = ''
+ chunk_size = 10240
+ while len(data) > 0:
+ chunk = data[:chunk_size]
+ data = data[chunk_size:]
+ if not str_data:
+ str_data = str(chunk)
+ else:
+ str_data += '.concat(' + str(chunk) + ')'
code += '''Module['FS_createDataFile']('/%s', '%s', %s, true, true);\n''' % (os.path.dirname(filename), os.path.basename(filename), str_data)
elif file_['mode'] == 'preload':
# Preload