Skip to content

Commit

Permalink
Ignore extraneous extension support warnings on travis
Browse files Browse the repository at this point in the history
  • Loading branch information
Strilanc committed Jun 8, 2018
1 parent 23128d0 commit 5c9150e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
2 changes: 2 additions & 0 deletions src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
12 changes: 10 additions & 2 deletions src/webgl/WglShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
12 changes: 6 additions & 6 deletions test/KarmaTestRunner.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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();
Expand Down
10 changes: 7 additions & 3 deletions test/TestUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
}
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 5c9150e

Please sign in to comment.