From 0d9a88446723b5558ce0328e5fc6a8351c4ce457 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 15 Jan 2016 14:35:22 -0800 Subject: wip waterfall build fetching --- check.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'check.py') diff --git a/check.py b/check.py index acc4c926e..8e22453d4 100755 --- a/check.py +++ b/check.py @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, shutil, sys, subprocess, difflib, json, time +import os, shutil, sys, subprocess, difflib, json, time, urllib2 interpreter = None requested = [] @@ -86,6 +86,35 @@ if not has_mozjs: if not has_emcc: warnings.append('warning: no emcc found (not checking emscripten/binaryen integration)') +# setup + +WATERFALL_BUILD = os.path.join('test', 'waterfall_build') + +def fetch_waterfall(): + rev = open(os.path.join('test', 'revision')).read() + try: + local_rev = open(os.path.join('test', 'local-revision')).read() + except: + local_rev = None + if local_rev == rev: return + # fetch it + print '(downloading waterfall ' + rev + ')' + basename = 'wasm-binaries-' + rev + '.tbz2' + downloaded = urllib2.urlopen('https://storage.googleapis.com/wasm-llvm/builds/git/' + basename).read().strip() + fullname = os.path.join('test', basename) + open(fullname, 'wb').write(downloaded) + print '(unpacking)' + if os.path.exists(WATERFALL_BUILD): + shutil.rmtree(WATERFALL_BUILD) + os.mkdir(WATERFALL_BUILD) + subprocess.check_call(['tar', '-xvf', os.path.abspath(fullname)], cwd=WATERFALL_BUILD) + print '(noting local revision)' + open(os.path.join('test', 'local-revision'), 'w').write(rev) + +fetch_waterfall() + +# tests + print '[ checking asm2wasm testcases... ]\n' for asm in tests: -- cgit v1.2.3