Bug 1332691: Add script to regenerate tests, update the WPT manifest and expectations; r=luke
authorBenjamin Bouvier <benj@benj.me>
Fri, 17 Feb 2017 20:13:54 +0100
changeset 391408 a75ac6014699ed0d432388b706891d3e6a9f71b1
parent 391407 f98c8a722582d8a44fd706dea2b6c2b7bcdb931a
child 391409 f675a1c2d70effba89474b5339768277a20297b4
push id7198
push userjlorenzo@mozilla.com
push dateTue, 18 Apr 2017 12:07:49 +0000
treeherdermozilla-beta@d57aa49c3948 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs1332691
milestone54.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1332691: Add script to regenerate tests, update the WPT manifest and expectations; r=luke MozReview-Commit-ID: DPFVJRiRiCT
.hgignore
js/src/wasm/Makefile
--- a/.hgignore
+++ b/.hgignore
@@ -39,16 +39,18 @@
 
 # SpiderMonkey configury
 ^js/src/configure$
 ^js/src/old-configure$
 ^js/src/autom4te.cache$
 # SpiderMonkey test result logs
 ^js/src/tests/results-.*\.(html|txt)$
 ^js/src/devtools/rootAnalysis/t/out
+# SpiderMonkey clone of the webassembly spec repository
+^js/src/wasm/spec
 
 # Java HTML5 parser classes
 ^parser/html/java/(html|java)parser/
 
 # SVN directories
 \.svn/
 
 # Ignore the files and directory that Eclipse IDE creates
new file mode 100644
--- /dev/null
+++ b/js/src/wasm/Makefile
@@ -0,0 +1,35 @@
+.PHONY: help update run expectations
+
+help:
+	@echo "Script to regenerate wasm test cases (JS and WPT) from the spec repository."
+	@echo ""
+	@echo "- a spec directory is needed under js/src/wasm (not checked in). It can be a"
+	@echo "  symbolic link or a real directory; if it's not there, the Makefile will clone"
+	@echo "  the repository from the sources."
+	@echo "- 'make update' makes sure the spec wast interpreter is up to date, regenerates"
+	@echo "  all the JS and WPT test cases, and put them in the right directories, then"
+	@echo "  updates the WPT manifest, if needed."
+	@echo "- 'MOZCONFIG=/path/to/bin/firefox make run' runs the WPT test cases and prints a"
+	@echo "  summary of the failures in the console."
+	@echo "- 'MOZCONFIG=/path/to/bin/firefox make expectations' runs the WPT test cases and"
+	@echo "  updates the expectations (known failures)."
+	@echo ""
+	@echo "Choose a rule: update or expectations."
+
+update:
+	[ -d ./spec ] || git clone https://github.com/webassembly/spec ./spec
+	(cd ./spec/interpreter && make)
+	./spec/test/build.py \
+		--js ../jit-test/tests/wasm/spec \
+		--html ../../../testing/web-platform/mozilla/tests/wasm
+	echo "|jit-test| test-also-wasm-baseline; include:wasm-testharness.js" > ../jit-test/tests/wasm/spec/directives.txt
+	../../../mach wpt-manifest-update
+
+run:
+	@[ -z $(MOZCONFIG) ] && echo "You need to define the MOZCONFIG env variable first."
+	@[ -z $(MOZCONFIG) ] || ../../../mach wpt /_mozilla/wasm
+
+expectations:
+	@[ -z $(MOZCONFIG) ] && echo "You need to define the MOZCONFIG env variable first." || true
+	@[ -z $(MOZCONFIG) ] || ../../../mach wpt /_mozilla/wasm --log-raw /tmp/expectations.log || true
+	@[ -z $(MOZCONFIG) ] || ../../../mach wpt-update /tmp/expectations.log --no-patch