feat: establish reproducible FreeCAD web compatibility baseline
This commit is contained in:
11
scripts/check-freecad-threeway.mjs
Normal file
11
scripts/check-freecad-threeway.mjs
Normal file
@@ -0,0 +1,11 @@
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { resolve } from 'node:path'
|
||||
|
||||
const root = resolve(new URL('..', import.meta.url).pathname)
|
||||
const report = JSON.parse(await readFile(resolve(root, 'config/freecad-bitbybit-native-threeway.json'), 'utf8'))
|
||||
if (report.schemaVersion !== 1 || report.unknownDifferencesFail !== true || report.scenarioCount !== 26 || !Array.isArray(report.reports)) throw new Error('Three-way Boolean report schema is invalid.')
|
||||
for (const entry of report.reports) {
|
||||
if (entry.bitbybit.differences.differences.length || entry.native.differences.differences.length) throw new Error(`Unknown three-way Boolean difference in ${entry.id}.`)
|
||||
if (!Number.isInteger(entry.native.historyRecordCount) || entry.native.historyRecordCount <= 0) throw new Error(`Missing native history records in ${entry.id}.`)
|
||||
}
|
||||
console.log(JSON.stringify({ status: 'freecad-threeway-pass', scenarioCount: report.scenarioCount, nativeOcctVersion: report.nativeOcctVersion }, null, 2))
|
||||
Reference in New Issue
Block a user