Use sdk/tests when syncing from upstream Khronos WebGL tests

This commit is contained in:
Anthony Ramine 2018-08-25 01:28:24 +02:00
parent 4852f7d616
commit 26a311fc62
2538 changed files with 61415 additions and 54538 deletions

View file

@ -10,25 +10,19 @@ import argparse
KHRONOS_REPO_URL = "https://github.com/KhronosGroup/WebGL.git"
# Patches for conformance tests 1.0.x
PATCHES_1X = [
("js-test-pre.patch", "resources/js-test-pre.js"),
PATCHES = [
("js-test-pre.patch", "js/js-test-pre.js"),
("unit.patch", "conformance/more/unit.js"),
("unit2.patch", "conformance/more/unit.js"),
("timeout.patch", None)
]
# Patches for conformance tests 2.0.x
PATCHES_2X = [
("js-test-pre2.patch", "js/js-test-pre.js"),
("unit.patch", "conformance/more/unit.js"),
("unit2.patch", "conformance/more/unit.js")
]
# Fix for 'UnicodeDecodeError: 'ascii' codec can't decode byte'
reload(sys)
sys.setdefaultencoding('utf8')
def usage():
print("Usage: {} version destination [existing_webgl_repo]".format(sys.argv[0]))
print("Usage: {} destination [existing_webgl_repo]".format(sys.argv[0]))
sys.exit(1)
def get_tests(base_dir, file_name, tests_list):
@ -76,8 +70,8 @@ def process_test(test):
def update_conformance(version, destination, existing_repo, patches_dir):
print("Trying to import WebGL conformance test suite {} into {}".format(version, destination))
def update_conformance(destination, existing_repo, patches_dir):
print("Trying to import WebGL tests into {}".format(destination))
if existing_repo:
directory = existing_repo
@ -87,7 +81,7 @@ def update_conformance(version, destination, existing_repo, patches_dir):
print("Cloning WebGL repository into temporary directory {}".format(directory))
subprocess.check_call(["git", "clone", KHRONOS_REPO_URL, directory, "--depth", "1"])
suite_dir = os.path.join(directory, "conformance-suites", version)
suite_dir = os.path.join(directory, "sdk/tests")
print("Test suite directory: {}".format(suite_dir))
if not os.path.isdir(suite_dir):
@ -133,8 +127,7 @@ def update_conformance(version, destination, existing_repo, patches_dir):
# Try to apply the patches to the required files
if not patches_dir:
patches_dir = os.path.abspath(os.path.dirname(sys.argv[0]))
patches = PATCHES_2X if version.startswith('2') else PATCHES_1X
for patch, file_name in patches:
for patch, file_name in PATCHES:
try:
patch = os.path.join(patches_dir, patch)
if file_name is None:
@ -147,12 +140,11 @@ def update_conformance(version, destination, existing_repo, patches_dir):
def main():
parser = argparse.ArgumentParser()
parser.add_argument("version", help="WebGL test suite version (e.g.: 1.0.3)")
parser.add_argument("destination", help="Test suite destination")
parser.add_argument("-e", "--existing-repo", help="Path to an existing clone of the khronos WebGL repository")
args = parser.parse_args()
update_conformance(args.version, args.destination, args.existing_repo, None)
update_conformance(args.destination, args.existing_repo, None)
if __name__ == '__main__':
main()

View file

@ -1,8 +1,6 @@
diff --git a/conformance-suites/1.0.3/resources/js-test-pre.js b/conformance-suites/1.0.3/resources/js-test-pre.js
index 2a03001..c4bb653 100644
--- a/conformance-suites/1.0.3/resources/js-test-pre.js
+++ b/conformance-suites/1.0.3/resources/js-test-pre.js
@@ -71,11 +71,25 @@ function nonKhronosFrameworkNotifyDone() {
--- js/js-test-pre.js
+++ js/js-test-pre.js
@@ -106,11 +106,25 @@
}
}
@ -30,22 +28,23 @@ index 2a03001..c4bb653 100644
-}
+}())
function notifyFinishedToHarness() {
function reportSkippedTestResultsToHarness(success, msg) {
if (window.parent.webglTestHarness) {
@@ -86,13 +100,19 @@ function notifyFinishedToHarness() {
@@ -127,6 +141,12 @@
}
}
+(function() {
+(function () {
+ var oldNotify = notifyFinishedToHarness;
+ var t = async_test("Overall test");
+ window.notifyFinishedToHarness = t.step_func_done(oldNotify);
+}())
+
function _logToConsole(msg)
{
if (window.console)
window.console.log(msg);
var _bufferedConsoleLogs = [];
function _bufferedLogToConsole(msg)
@@ -157,7 +177,7 @@
}
}
-var _jsTestPreVerboseLogging = false;
@ -53,7 +52,7 @@ index 2a03001..c4bb653 100644
function enableJSTestPreVerboseLogging()
{
@@ -105,31 +125,18 @@ function description(msg)
@@ -170,24 +190,11 @@
if (msg === undefined) {
msg = document.title;
}
@ -66,9 +65,9 @@ index 2a03001..c4bb653 100644
- else
- description.appendChild(span);
- if (_jsTestPreVerboseLogging) {
- _logToConsole(msg);
- _bufferedLogToConsole(msg);
- }
+ _logToConsole("DESCRIPTION: " + msg);
+ _bufferedLogToConsole("DESCRIPTION: " + msg);
}
function _addSpan(contents)
@ -79,20 +78,3 @@ index 2a03001..c4bb653 100644
}
function debug(msg)
{
_addSpan(msg);
if (_jsTestPreVerboseLogging) {
- _logToConsole(msg);
+ _logToConsole(msg);
}
}
@@ -143,7 +150,7 @@ function testPassed(msg)
reportTestResultsToHarness(true, msg);
_addSpan('<span><span class="pass">PASS</span> ' + escapeHTML(msg) + '</span>');
if (_jsTestPreVerboseLogging) {
- _logToConsole('PASS ' + msg);
+ _logToConsole('PASS ' + msg);
}
}

View file

@ -82,6 +82,18 @@ index 5af87433aa..79afd9f430 100644
<title>WebGL GLSL conformance test: asin_001_to_006.html</title>
<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
<link rel="stylesheet" href="../../../resources/ogles-tests.css" />
diff --git i/conformance/ogles/GL/log/log_001_to_008.html w/conformance/ogles/GL/log/log_001_to_008.html
index 5552a4f82e..539cb33214 100644
--- i/conformance/ogles/GL/log/log_001_to_008.html
+++ w/conformance/ogles/GL/log/log_001_to_008.html
@@ -28,6 +28,7 @@
<html>
<head>
<meta charset="utf-8">
+<meta name="timeout" content="long">
<title>WebGL GLSL conformance test: log_001_to_008.html</title>
<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
<link rel="stylesheet" href="../../../resources/ogles-tests.css" />
diff --git i/conformance/ogles/GL/log2/log2_001_to_008.html w/conformance/ogles/GL/log2/log2_001_to_008.html
index 5552a4f82e..539cb33214 100644
--- i/conformance/ogles/GL/log2/log2_001_to_008.html