Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 90400d967f |
@@ -8,4 +8,4 @@ npx road-compiler --input /absolute/path/road-compiler.input.json
|
|||||||
|
|
||||||
The compiler does not read host area configuration. The caller owns configuration normalization and creates the input JSON. Successful compilation writes exactly one `NATIVE_ROAD_COMPILE_DONE` JSON marker to stdout.
|
The compiler does not read host area configuration. The caller owns configuration normalization and creates the input JSON. Successful compilation writes exactly one `NATIVE_ROAD_COMPILE_DONE` JSON marker to stdout.
|
||||||
|
|
||||||
Run `npm test` and `npm run test:road-parity` after `npm ci` to validate the package without the host repository.
|
Run `npm test` after `npm ci` to validate the package and its two self-contained area fixtures without the host repository. The migrated baselines remain upgrade corpus; the host repository owns the strict path-normalized parity gate.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@osm-asset/road-compiler",
|
"name": "@osm-asset/road-compiler",
|
||||||
"version": "0.1.0",
|
"version": "0.1.2",
|
||||||
"private": false,
|
"private": false,
|
||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
@@ -8,8 +8,7 @@
|
|||||||
"road-compiler": "bin/road-compiler.js"
|
"road-compiler": "bin/road-compiler.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "node test/index.js",
|
"test": "node test/index.js && node test/fixtures.js",
|
||||||
"test:road-parity": "node test/road-parity.js",
|
|
||||||
"road:workbench": "node bin/road-workbench.js"
|
"road:workbench": "node bin/road-workbench.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
27
test/fixtures.js
Normal file
27
test/fixtures.js
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
"use strict";
|
||||||
|
|
||||||
|
const assert = require("assert/strict");
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
const { compiler } = require("../src");
|
||||||
|
|
||||||
|
const root = path.resolve(__dirname, "..");
|
||||||
|
for (const areaId of ["fengshu-er-road", "nantaizi-lake-innovation-valley"]) {
|
||||||
|
const isFengshu = areaId === "fengshu-er-road";
|
||||||
|
const outputRoot = path.join(root, "outputs", areaId);
|
||||||
|
const input = {
|
||||||
|
areaId,
|
||||||
|
osmFile: path.join(root, "inputs", "osm", isFengshu ? "枫树二路.osm" : "南台子湖创新谷OSM.osm"),
|
||||||
|
outDir: path.join(outputRoot, "native-road"),
|
||||||
|
stagingDir: path.join(outputRoot, "_pipeline"),
|
||||||
|
overridesFile: path.join(outputRoot, "native-road-overrides.json"),
|
||||||
|
trafficSignalsFile: path.join(outputRoot, "native-traffic-signals.json"),
|
||||||
|
comparisonDir: path.join(outputRoot, "osm2streets_web_out"),
|
||||||
|
options: { edgeLines: false, junctionTemplates: { enabled: false, references: [] } },
|
||||||
|
};
|
||||||
|
assert.ok(fs.existsSync(path.join(root, "test", "baseline", `${areaId}.json`)));
|
||||||
|
const { result } = compiler.compileInput(input);
|
||||||
|
assert.equal(result.areaId, areaId);
|
||||||
|
assert.ok(fs.existsSync(path.join(input.outDir, "compiled.json")));
|
||||||
|
}
|
||||||
|
console.log("road compiler fixture tests passed");
|
||||||
Reference in New Issue
Block a user