summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-15 14:35:22 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-17 11:57:08 -0800
commit0d9a88446723b5558ce0328e5fc6a8351c4ce457 (patch)
treed9d4d66e1c01a841f1b6a370469f31900d04872f
parent58be64a9b1f00d399383852a858df7e514d7b535 (diff)
downloadbinaryen-0d9a88446723b5558ce0328e5fc6a8351c4ce457.tar.gz
binaryen-0d9a88446723b5558ce0328e5fc6a8351c4ce457.tar.bz2
binaryen-0d9a88446723b5558ce0328e5fc6a8351c4ce457.zip
wip waterfall build fetching
-rwxr-xr-xcheck.py31
1 files changed, 30 insertions, 1 deletions
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: