diff --git a/emscripten-releases-tags.txt b/emscripten-releases-tags.txt index 849c109..1560697 100644 --- a/emscripten-releases-tags.txt +++ b/emscripten-releases-tags.txt @@ -1,6 +1,7 @@ { - "latest": "1.38.35", + "latest": "1.38.36", "releases": { + "1.38.36": "d46be49c2aab975333423122239892bd46f52bba", "1.38.35": "98f49919f25e06fa557cbcb1321d4c10e60c87ca", "1.38.34": "048cf9424790cc525a7ea6da340820aae226f3b9", "1.38.33": "3b8cff670e9233a6623563add831647e8689a86b" diff --git a/test.py b/test.py index eed2ed1..2a20bf3 100644 --- a/test.py +++ b/test.py @@ -1,3 +1,4 @@ +import json import os import shutil import subprocess @@ -9,6 +10,12 @@ import tempfile def check_call(cmd): subprocess.check_call(cmd.split(' ')) +def checked_call_with_output(cmd, expected, stderr=None): + proc = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE, stderr=stderr) + stdout, stderr = proc.communicate() + assert not proc.returncode, 'call must have succeeded' + assert expected in (stdout + stderr), 'call did not have the right output: ' + stdout + stderr + def failing_call_with_output(cmd, expected): proc = subprocess.Popen(cmd.split(' '), stdout=subprocess.PIPE) stdout, stderr = proc.communicate() @@ -27,6 +34,8 @@ def hack_emsdk(marker, replacement): open('hello_world.cpp', 'w').write('int main() {}') +TAGS = json.loads(open('emscripten-releases-tags.txt').read()) + # Tests print('update') @@ -44,6 +53,9 @@ assert open(os.path.expanduser('~/.emscripten')).read().count('LLVM_ROOT') == 1 assert 'upstream' in open(os.path.expanduser('~/.emscripten')).read() assert 'fastcomp' not in open(os.path.expanduser('~/.emscripten')).read() +print('verify version') +checked_call_with_output('upstream/emscripten/emcc -v', TAGS['latest'], stderr=subprocess.PIPE) + print('test tot-upstream') check_call('./emsdk install tot-upstream') check_call('./emsdk activate tot-upstream') @@ -89,5 +101,18 @@ for filename in os.listdir('.'): os.chdir(temp_dir) +check_call('python ./emsdk update') +print('second time') check_call('python ./emsdk update') +print('verify downloads exist for all OSes') +latest_hash = TAGS['releases'][TAGS['latest']] +for os, suffix in [ + ('linux', 'tbz2'), + ('mac', 'tbz2'), + ('win', 'zip') +]: + url = 'https://storage.googleapis.com/webassembly/emscripten-releases-builds/%s/%s/wasm-binaries.%s' % (os, latest_hash, suffix) + print(' url: ' + url), + check_call('wget ' + url) +