servo: Merge #19065 - Import WebGL tests separately from web-platform-tests (from MortimerGoro:webgl_wpt); r=jdm
authorImanol Fernandez <mortimergoro@gmail.com>
Tue, 31 Oct 2017 10:04:45 -0500
changeset 389441 f472eced43b511e93e738714868eb141de7f5553
parent 389440 e1b4f786f584644f186a08a76413679477be99e5
child 389442 cd1e9860b7d61c8348e2ac85b1fb9fd854a651d5
push id96855
push userarchaeopteryx@coole-files.de
push dateTue, 31 Oct 2017 23:40:37 +0000
treeherdermozilla-inbound@285362745f60 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
milestone58.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
servo: Merge #19065 - Import WebGL tests separately from web-platform-tests (from MortimerGoro:webgl_wpt); r=jdm Import WebGL tests separately from web-platform-tests <!-- Please describe your changes on the following line: --> See https://github.com/servo/servo/issues/17140 Changes included in this PR: - Move webgl tests from web-platform-tests to mozilla tests - Create a mach command to allow easy updating from Khronos WebGL upstream ( `./mach update-webgl` or `./mach update-webgl --version 1.0.3`) - Fix WebGL patches to make them compatible with upstream. - Sync with upstream 1.0.3 WebGL conformance suite using the new `./mach update-webgl` command --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #17140 (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: b74f52d6df118d832db08276ebe698fee2fa2265
servo/python/servo/testing_commands.py
servo/python/tidy/servo_tidy/tidy.py
servo/servo-tidy.toml
--- a/servo/python/servo/testing_commands.py
+++ b/servo/python/servo/testing_commands.py
@@ -15,16 +15,17 @@ import sys
 import os
 import os.path as path
 import copy
 from collections import OrderedDict
 from time import time
 import json
 import urllib2
 import base64
+import shutil
 
 from mach.registrar import Registrar
 from mach.decorators import (
     CommandArgument,
     CommandProvider,
     Command,
 )
 
@@ -924,8 +925,29 @@ testing/web-platform/mozilla/tests for S
     def update_net_cookies(self):
         cache_dir = path.join(self.config["tools"]["cache-dir"], "tests")
         run_file = path.abspath(path.join(PROJECT_TOPLEVEL_PATH,
                                           "tests", "unit", "net",
                                           "cookie_http_state_utils.py"))
         run_globals = {"__file__": run_file}
         execfile(run_file, run_globals)
         return run_globals["update_test_file"](cache_dir)
+
+    @Command('update-webgl',
+             description='Update the WebGL conformance suite tests from Khronos repo',
+             category='testing')
+    @CommandArgument('--version', action='store_true', default='1.0.3',
+                     help='WebGL conformance suite version')
+    def update_webgl(self, version=None):
+        self.ensure_bootstrapped()
+
+        base_dir = path.abspath(path.join(PROJECT_TOPLEVEL_PATH,
+                                "tests", "wpt", "mozilla", "tests", "webgl"))
+        run_file = path.join(base_dir, "tools", "import-conformance-tests.py")
+        dest_folder = path.join(base_dir, "conformance-%s" % version)
+        patches_dir = path.join(base_dir, "tools")
+        # Clean dest folder if exists
+        if os.path.exists(dest_folder):
+            shutil.rmtree(dest_folder)
+
+        run_globals = {"__file__": run_file}
+        execfile(run_file, run_globals)
+        return run_globals["update_conformance"](version, dest_folder, None, patches_dir)
--- a/servo/python/tidy/servo_tidy/tidy.py
+++ b/servo/python/tidy/servo_tidy/tidy.py
@@ -48,17 +48,17 @@ COMMENTS = ["// ", "# ", " *", "/* "]
 
 # File patterns to include in the non-WPT tidy check.
 FILE_PATTERNS_TO_CHECK = ["*.rs", "*.rc", "*.cpp", "*.c",
                           "*.h", "Cargo.lock", "*.py", "*.sh",
                           "*.toml", "*.webidl", "*.json", "*.html",
                           "*.yml"]
 
 # File patterns that are ignored for all tidy and lint checks.
-FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc", "fake-ld.sh"]
+FILE_PATTERNS_TO_IGNORE = ["*.#*", "*.pyc", "fake-ld.sh", "*.ogv", "*.webm"]
 
 SPEC_BASE_PATH = "components/script/dom/"
 
 WEBIDL_STANDARDS = [
     "//www.khronos.org/registry/webgl/extensions",
     "//www.khronos.org/registry/webgl/specs",
     "//developer.mozilla.org/en-US/docs/Web/API",
     "//dev.w3.org/2006/webapi",
--- a/servo/servo-tidy.toml
+++ b/servo/servo-tidy.toml
@@ -65,16 +65,17 @@ files = [
 directories = [
   # Upstream
   "./support/android/apk",
   "./tests/wpt/css-tests",
   "./tests/wpt/harness",
   "./tests/wpt/update",
   "./tests/wpt/web-platform-tests",
   "./tests/wpt/mozilla/tests/mozilla/referrer-policy",
+  "./tests/wpt/mozilla/tests/webgl",
   "./tests/wpt/sync",
   "./tests/wpt/sync_css",
   "./python/tidy/servo_tidy_tests",
   "./components/script/dom/bindings/codegen/parser",
   "./components/script/dom/bindings/codegen/ply",
   "./python/_virtualenv",
   "./components/hashglobe/src",
   # Generated and upstream code combined with our own. Could use cleanup