Rename the integration test to the reference test to be more specific
This commit is contained in:
parent
99c7e685e7
commit
6d85cb3382
|
@ -19,7 +19,7 @@
|
|||
ref="/" aria-haspopup="true" aria-expanded="false">Tools</a>
|
||||
<div class="dropdown-menu" aria-labelledby="pf-tools-menu">
|
||||
<a class="dropdown-item" href="/tools/benchmark">Benchmark</a>
|
||||
<a class="dropdown-item" href="/tools/integration-test">Integration Test</a>
|
||||
<a class="dropdown-item" href="/tools/reference-test">Reference Test</a>
|
||||
<a class="dropdown-item" href="/tools/mesh-debugger">Mesh Debugger</a>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Integration Test — Pathfinder</title>
|
||||
<title>Reference Test — Pathfinder</title>
|
||||
<meta charset="utf-8">
|
||||
{{>partials/header.html}}
|
||||
<script type="text/javascript" src="/js/pathfinder/integration-test.js"></script>
|
||||
<script type="text/javascript" src="/js/pathfinder/reference-test.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="pf-outer-container" class="w-100">
|
||||
|
@ -13,7 +13,7 @@
|
|||
</div>
|
||||
<div id="pf-inner-container" class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="pf-integration-test-sidebar" class="col p-3">
|
||||
<div id="pf-reference-test-sidebar" class="col p-3">
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" id="pf-test-suite-tab" data-toggle="tab"
|
|
@ -1,4 +1,4 @@
|
|||
// pathfinder/client/src/integration-test.ts
|
||||
// pathfinder/client/src/reference-test.ts
|
||||
//
|
||||
// Copyright © 2017 The Pathfinder Project Developers.
|
||||
//
|
||||
|
@ -40,17 +40,17 @@ const ANTIALIASING_STRATEGIES: AntialiasingStrategyTable = {
|
|||
};
|
||||
|
||||
const RENDER_REFERENCE_URI: string = "/render-reference";
|
||||
const TEST_DATA_URI: string = "/test-data/integration-test-text.csv";
|
||||
const TEST_DATA_URI: string = "/test-data/reference-test-text.csv";
|
||||
|
||||
const SSIM_TOLERANCE: number = 0.01;
|
||||
const SSIM_WINDOW_SIZE: number = 8;
|
||||
|
||||
interface IntegrationTestGroup {
|
||||
interface ReferenceTestGroup {
|
||||
font: string;
|
||||
tests: IntegrationTestCase[];
|
||||
tests: ReferenceTestCase[];
|
||||
}
|
||||
|
||||
interface IntegrationTestCase {
|
||||
interface ReferenceTestCase {
|
||||
size: number;
|
||||
character: string;
|
||||
aaMode: keyof AntialiasingStrategyTable;
|
||||
|
@ -67,13 +67,13 @@ interface AntialiasingStrategyTable {
|
|||
xcaa: typeof AdaptiveMonochromeXCAAStrategy;
|
||||
}
|
||||
|
||||
class IntegrationTestAppController extends DemoAppController<IntegrationTestView> {
|
||||
class ReferenceTestAppController extends DemoAppController<ReferenceTestView> {
|
||||
font: PathfinderFont | null;
|
||||
textRun: TextRun | null;
|
||||
|
||||
referenceCanvas: HTMLCanvasElement;
|
||||
|
||||
tests: Promise<IntegrationTestGroup[]>;
|
||||
tests: Promise<ReferenceTestGroup[]>;
|
||||
|
||||
protected readonly defaultFile: string = FONT;
|
||||
protected readonly builtinFileURI: string = BUILTIN_FONT_URI;
|
||||
|
@ -167,7 +167,7 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
this.loadInitialFile(this.builtinFileURI);
|
||||
}
|
||||
|
||||
runNextTestIfNecessary(tests: IntegrationTestGroup[]): void {
|
||||
runNextTestIfNecessary(tests: ReferenceTestGroup[]): void {
|
||||
if (this.currentTestGroupIndex == null || this.currentTestCaseIndex == null ||
|
||||
this.currentGlobalTestCaseIndex == null) {
|
||||
return;
|
||||
|
@ -193,7 +193,7 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
});
|
||||
}
|
||||
|
||||
recordSSIMResult(tests: IntegrationTestGroup[], ssimResult: imageSSIM.IResult): void {
|
||||
recordSSIMResult(tests: ReferenceTestGroup[], ssimResult: imageSSIM.IResult): void {
|
||||
const formattedSSIM: string = "" + (Math.round(ssimResult.ssim * 1000.0) / 1000.0);
|
||||
this.ssimLabel.textContent = formattedSSIM;
|
||||
|
||||
|
@ -234,8 +234,8 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
protected createView(gammaLUT: HTMLImageElement,
|
||||
commonShaderSource: string,
|
||||
shaderSources: ShaderMap<ShaderProgramSource>):
|
||||
IntegrationTestView {
|
||||
return new IntegrationTestView(this, gammaLUT, commonShaderSource, shaderSources);
|
||||
ReferenceTestView {
|
||||
return new ReferenceTestView(this, gammaLUT, commonShaderSource, shaderSources);
|
||||
}
|
||||
|
||||
protected fileLoaded(fileData: ArrayBuffer, builtinName: string | null): void {
|
||||
|
@ -252,7 +252,7 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
.then(response => response.text())
|
||||
.then(testDataText => {
|
||||
const fontNames = [];
|
||||
const groups: {[font: string]: IntegrationTestCase[]} = {};
|
||||
const groups: {[font: string]: ReferenceTestCase[]} = {};
|
||||
|
||||
const testData = papaparse.parse(testDataText, {
|
||||
comments: "#",
|
||||
|
@ -324,7 +324,7 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
});
|
||||
}
|
||||
|
||||
private loadFontForTestGroupIfNecessary(tests: IntegrationTestGroup[]): Promise<void> {
|
||||
private loadFontForTestGroupIfNecessary(tests: ReferenceTestGroup[]): Promise<void> {
|
||||
return new Promise(resolve => {
|
||||
if (this.currentTestGroupIndex == null) {
|
||||
resolve();
|
||||
|
@ -337,7 +337,7 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
});
|
||||
}
|
||||
|
||||
private setOptionsForCurrentTest(tests: IntegrationTestGroup[]): Promise<void> {
|
||||
private setOptionsForCurrentTest(tests: ReferenceTestGroup[]): Promise<void> {
|
||||
if (this.currentTestGroupIndex == null || this.currentTestCaseIndex == null)
|
||||
return new Promise(resolve => resolve());
|
||||
|
||||
|
@ -411,22 +411,22 @@ class IntegrationTestAppController extends DemoAppController<IntegrationTestView
|
|||
}
|
||||
}
|
||||
|
||||
class IntegrationTestView extends DemoView {
|
||||
readonly renderer: IntegrationTestRenderer;
|
||||
readonly appController: IntegrationTestAppController;
|
||||
class ReferenceTestView extends DemoView {
|
||||
readonly renderer: ReferenceTestRenderer;
|
||||
readonly appController: ReferenceTestAppController;
|
||||
|
||||
get camera(): OrthographicCamera {
|
||||
return this.renderer.camera;
|
||||
}
|
||||
|
||||
constructor(appController: IntegrationTestAppController,
|
||||
constructor(appController: ReferenceTestAppController,
|
||||
gammaLUT: HTMLImageElement,
|
||||
commonShaderSource: string,
|
||||
shaderSources: ShaderMap<ShaderProgramSource>) {
|
||||
super(gammaLUT, commonShaderSource, shaderSources);
|
||||
|
||||
this.appController = appController;
|
||||
this.renderer = new IntegrationTestRenderer(this);
|
||||
this.renderer = new ReferenceTestRenderer(this);
|
||||
|
||||
this.resizeToFit(true);
|
||||
}
|
||||
|
@ -465,8 +465,8 @@ class IntegrationTestView extends DemoView {
|
|||
}
|
||||
}
|
||||
|
||||
class IntegrationTestRenderer extends Renderer {
|
||||
renderContext: IntegrationTestView;
|
||||
class ReferenceTestRenderer extends Renderer {
|
||||
renderContext: ReferenceTestView;
|
||||
camera: OrthographicCamera;
|
||||
|
||||
get destFramebuffer(): WebGLFramebuffer | null {
|
||||
|
@ -529,7 +529,7 @@ class IntegrationTestRenderer extends Renderer {
|
|||
return computeStemDarkeningAmount(appController.currentFontSize, this.pixelsPerUnit);
|
||||
}
|
||||
|
||||
constructor(renderContext: IntegrationTestView) {
|
||||
constructor(renderContext: ReferenceTestView) {
|
||||
super(renderContext);
|
||||
|
||||
this.camera = new OrthographicCamera(renderContext.canvas);
|
||||
|
@ -700,7 +700,7 @@ function addCell(row: HTMLTableRowElement, text: string): void {
|
|||
}
|
||||
|
||||
function main() {
|
||||
const controller = new IntegrationTestAppController;
|
||||
const controller = new ReferenceTestAppController;
|
||||
window.addEventListener('load', () => controller.start(), false);
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ module.exports = {
|
|||
'3d-demo': "./src/3d-demo.ts",
|
||||
'svg-demo': "./src/svg-demo.ts",
|
||||
'text-demo': "./src/text-demo.ts",
|
||||
'integration-test': "./src/integration-test.ts",
|
||||
'reference-test': "./src/reference-test.ts",
|
||||
'benchmark': "./src/benchmark.ts",
|
||||
'mesh-debugger': "./src/mesh-debugger.ts",
|
||||
},
|
||||
|
|
|
@ -73,7 +73,7 @@ static STATIC_TEXT_DEMO_PATH: &'static str = "../client/text-demo.html";
|
|||
static STATIC_SVG_DEMO_PATH: &'static str = "../client/svg-demo.html";
|
||||
static STATIC_3D_DEMO_PATH: &'static str = "../client/3d-demo.html";
|
||||
static STATIC_TOOLS_BENCHMARK_PATH: &'static str = "../client/benchmark.html";
|
||||
static STATIC_TOOLS_INTEGRATION_TEST_PATH: &'static str = "../client/integration-test.html";
|
||||
static STATIC_TOOLS_REFERENCE_TEST_PATH: &'static str = "../client/reference-test.html";
|
||||
static STATIC_TOOLS_MESH_DEBUGGER_PATH: &'static str = "../client/mesh-debugger.html";
|
||||
static STATIC_DOC_API_PATH: &'static str = "../../font-renderer/target/doc";
|
||||
static STATIC_CSS_BOOTSTRAP_PATH: &'static str = "../client/node_modules/bootstrap/dist/css";
|
||||
|
@ -557,9 +557,9 @@ fn static_demo_3d() -> io::Result<NamedFile> {
|
|||
fn static_tools_benchmark() -> io::Result<NamedFile> {
|
||||
NamedFile::open(STATIC_TOOLS_BENCHMARK_PATH)
|
||||
}
|
||||
#[get("/tools/integration-test")]
|
||||
fn static_tools_integration_test() -> io::Result<NamedFile> {
|
||||
NamedFile::open(STATIC_TOOLS_INTEGRATION_TEST_PATH)
|
||||
#[get("/tools/reference-test")]
|
||||
fn static_tools_reference_test() -> io::Result<NamedFile> {
|
||||
NamedFile::open(STATIC_TOOLS_REFERENCE_TEST_PATH)
|
||||
}
|
||||
#[get("/tools/mesh-debugger")]
|
||||
fn static_tools_mesh_debugger() -> io::Result<NamedFile> {
|
||||
|
@ -678,7 +678,7 @@ fn main() {
|
|||
static_demo_svg,
|
||||
static_demo_3d,
|
||||
static_tools_benchmark,
|
||||
static_tools_integration_test,
|
||||
static_tools_reference_test,
|
||||
static_tools_mesh_debugger,
|
||||
static_doc_api_index,
|
||||
static_doc_api,
|
||||
|
|
Loading…
Reference in New Issue