mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-10 21:32:23 +00:00
Run the conformance logic suite on the Cesium renderer
The conformance page can now run the logic checks against the Cesium
scene renderer as well as the stub. CESIUM_CHECKS lists the checks of
the ports Cesium already has; each phase 2 migration adds its own, so
the suite shows how far the renderer is through the contract. All eight
listed checks pass in the browser, and the stub still passes its 69.
A harness frame is one tick of the render loop, observed through
frame.on('preUpdate'). It asks for no frame itself, so a check's own
requestRender is what makes a tick draw, and a loop that stops fails
the check after five seconds instead of hanging the run. The harness
frees each WebGL context on destroy.
FrameTime.dt is now measured rather than fixed at 1/60, and renderOnce
honours timeoutMs. A scene renderer made without the models capability
has no draw.models.
This commit is contained in:
1 parent
a5143f4467
commit
92fd2b0c2e
6 files changed
+170
-16
No files matched your search
+19
-4
@@ -20,6 +20,10 @@ import {
|
||||
import { createStubHarness } from '../../src/render/stub/harness.js';
|
||||
import { toEcef } from '../../src/render/stub/math.js';
|
||||
import { createCesiumSceneRenderer } from '../../src/render/cesium/sceneRenderer.js';
|
||||
import {
|
||||
CESIUM_CHECKS,
|
||||
createCesiumHarness,
|
||||
} from '../../src/render/cesium/harness.js';
|
||||
|
||||
const REFERENCES = '/src/render/conformance/goldens/visual/';
|
||||
const SAVE = '/__conformance/references/';
|
||||
@@ -31,9 +35,19 @@ const RENDERERS = {
|
||||
cesium: () => createCesiumSceneRenderer({ container: $('stage') }),
|
||||
};
|
||||
|
||||
async function runLogic() {
|
||||
status('running the logic suite…');
|
||||
const report = await runConformance(createStubHarness('stub (browser)'));
|
||||
const HARNESSES = {
|
||||
stub: () => [createStubHarness('stub (browser)'), {}],
|
||||
cesium: () => [
|
||||
createCesiumHarness({ model: ctx.assets.model }),
|
||||
{ only: (id) => CESIUM_CHECKS.has(id) },
|
||||
],
|
||||
};
|
||||
|
||||
/** Runs the logic suite on `which`; `all` runs every check, listed or not. */
|
||||
async function runLogic(which = 'stub', { all = false } = {}) {
|
||||
status(`running the logic suite on ${which}…`);
|
||||
const [harness, options] = HARNESSES[which]();
|
||||
const report = await runConformance(harness, all ? {} : options);
|
||||
$('logicResults').innerHTML =
|
||||
`<p>${report.harness}: <b class="pass">${report.passed} passed</b>, <b class="fail">${report.failed} failed</b>, ${report.skipped} skipped</p>
|
||||
<table>${report.results
|
||||
@@ -209,7 +223,8 @@ async function runScenes({ record = false, only } = {}) {
|
||||
return results;
|
||||
}
|
||||
|
||||
$('logic').onclick = () => runLogic();
|
||||
$('logic').onclick = () => runLogic('stub');
|
||||
$('logicCesium').onclick = () => runLogic('cesium');
|
||||
$('check').onclick = () => runScenes();
|
||||
$('record').onclick = () => runScenes({ record: true });
|
||||
window.conformance = { runLogic, runScenes };
|
||||
Reference in new issue
Block a user