From 5c9150e0e3617a1ea2c8fb6e2f77943d6bfc4964 Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Fri, 8 Jun 2018 03:09:12 -0300 Subject: [PATCH] Ignore extraneous extension support warnings on travis --- src/Config.js | 2 ++ src/webgl/WglShader.js | 12 ++++++++++-- test/KarmaTestRunner.test.js | 12 ++++++------ test/TestUtil.js | 10 +++++++--- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/Config.js b/src/Config.js index e6bccfb8..a5e518fb 100644 --- a/src/Config.js +++ b/src/Config.js @@ -92,4 +92,6 @@ Config.DEFAULT_STROKE_THICKNESS = 1; Config.CHECK_WEB_GL_ERRORS_EVEN_ON_HOT_PATHS = false; Config.SEMI_STABLE_RANDOM_VALUE_LIFETIME_MILLIS = 300; +Config.IGNORED_WEBGL_INFO_TERMS = []; + export {Config} diff --git a/src/webgl/WglShader.js b/src/webgl/WglShader.js index 2ec57a19..5df35f4a 100644 --- a/src/webgl/WglShader.js +++ b/src/webgl/WglShader.js @@ -219,8 +219,16 @@ class WglCompiledShader { let info = gl.getShaderInfoLog(shader); if (info !== '') { - console.warn("WebGLShader: gl.getShaderInfoLog() wasn't empty: " + gl.getShaderInfoLog(shader)); - console.warn("Source code was: " + sourceCode); + let ignored = false; + for (let term in Config.IGNORED_WEBGL_INFO_TERMS) { + if (info.indexOf(term)) { + ignored = true; + } + } + if (!ignored) { + console.warn("WebGLShader: gl.getShaderInfoLog() wasn't empty: " + gl.getShaderInfoLog(shader)); + console.warn("Source code was: " + sourceCode); + } } if (gl.getShaderParameter(shader, WebGLRenderingContext.COMPILE_STATUS) === false) { diff --git a/test/KarmaTestRunner.test.js b/test/KarmaTestRunner.test.js index cdc5215a..181dfcf5 100644 --- a/test/KarmaTestRunner.test.js +++ b/test/KarmaTestRunner.test.js @@ -51,11 +51,8 @@ let promiseRunTest = (suite, name, method) => { return promise.then(() => { result.success = true; - if (status.warn_only) { - let msg = status.warn_message !== undefined ? - status.warn_message : - `${suite.name}.${name} passed, but is set to warn_only (${status.warn_only})`; - console.warn(msg); + if (status.warn_only && !status.ignore_warn_only_on_success) { + console.warn(`${suite.name}.${name} passed, but is set to warn_only (${status.warn_only})`); } return finish(); }, ex => { @@ -72,7 +69,10 @@ let promiseRunTest = (suite, name, method) => { result.log.push(stackMsg); } if (status.warn_only) { - console.warn(`${suite.name}.${name} FAILED, but is set to warn_only (${status.warn_only})`) + let msg = status.warn_failure_message !== undefined ? + status.warn_failure_message : + `${suite.name}.${name} FAILED, but is set to warn_only (${status.warn_only})`; + console.warn(msg); } result.success = status.warn_only; return finish(); diff --git a/test/TestUtil.js b/test/TestUtil.js index 664e1a04..689d2b77 100644 --- a/test/TestUtil.js +++ b/test/TestUtil.js @@ -322,8 +322,11 @@ function isWebGLSupportPresent() { // HACK: tests on travis-ci give this warning when compiling shaders, and then give // bad test results. Checking for it is a workaround to make the build pass. - __onlyPartialWebGLSupportPresent = ( - ctx.getShaderInfoLog(shader).indexOf("extension `GL_ARB_gpu_shader5' unsupported") !== -1); + let term = "extension `GL_ARB_gpu_shader5' unsupported"; + __onlyPartialWebGLSupportPresent = ctx.getShaderInfoLog(shader).indexOf(term) !== -1; + if (__onlyPartialWebGLSupportPresent) { + Config.IGNORED_WEBGL_INFO_TERMS.push(term); + } } } } @@ -421,7 +424,8 @@ export class Suite { return; } else if (isOnlyPartialWebGLSupportPresent()) { status.warn_only = true; - status.warn_message = `Ignoring ${this.name}.${caseName} failure due to lack of WebGL support.`; + status.ignore_warn_only_on_success = true; + status.warn_failure_message = `Ignoring ${this.name}.${caseName} failure due to lack of WebGL support.`; } let preTexCount = WglTexturePool.getUnReturnedTextureCount();