aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-04-09 16:09:44 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-04-09 16:09:44 +0300
commit19c1821f0e9740c6fcf6ed5b2bdf976d2b098558 (patch)
tree63737770258f275955fda24bfc1a83e31fa9898f
parent4d0decb3b774d61f7f1bba7e74547d2c2d36fbfb (diff)
Ease use with tools/validate_asmjs.py by making it look for a corresponding .js file if a .html file without asm.js code is given. This matches the convention of emcc output, which generates .html and .js files with same basename.
-rw-r--r--tools/validate_asmjs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/validate_asmjs.py b/tools/validate_asmjs.py
index ea909fbd..4136af93 100644
--- a/tools/validate_asmjs.py
+++ b/tools/validate_asmjs.py
@@ -59,6 +59,11 @@ def validate_asmjs(filename, muteOutput):
if not valid_asmjs:
return False
if numAsmJsBlocks == 0:
+ # Test a .js file with the same basename - emcc convention
+ # is to generate files with same basename but different suffix.
+ js_file = filename.replace('.html', '.js')
+ if os.path.isfile(js_file):
+ return validate_asmjs(js_file, muteOutput)
if not muteOutput:
print >> sys.stderr, 'Error: the file does not contain any "use asm" modules.'
return False