43 lines
2.3 KiB
JavaScript
43 lines
2.3 KiB
JavaScript
import test from 'node:test'
|
|
import assert from 'node:assert/strict'
|
|
import { readFile } from 'node:fs/promises'
|
|
import { resolve } from 'node:path'
|
|
|
|
const root = resolve(new URL('..', import.meta.url).pathname)
|
|
|
|
test('Qt wasm Core build pins the released QtBase source and project Emscripten baseline', async () => {
|
|
const source = await readFile(resolve(root, 'scripts/build-qt6-wasm-core.sh'), 'utf8')
|
|
assert.match(source, /QT_VERSION="6\.8\.2"/)
|
|
assert.match(source, /012043ce6d411e6e8a91fdc4e05e6bedcfa10fcb1347d3c33908f7fdd10dfe05/)
|
|
assert.match(source, /Emscripten 3\.1\.69/)
|
|
assert.match(source, /mirrors\.ustc\.edu\.cn/)
|
|
assert.match(source, /WEB_FREECAD_OFFLINE/)
|
|
assert.match(source, /cmake --install "\$\{QT_BUILD_DIR\}\/src\/corelib"/)
|
|
assert.doesNotMatch(source, /cmake --install[^\n]+\|\| true/)
|
|
})
|
|
|
|
test('FreeCAD source probe pins the exact private source inputs and does not export the production ABI', async () => {
|
|
const build = await readFile(resolve(root, 'scripts/build-freecad-naming-source-probe.sh'), 'utf8')
|
|
const smoke = await readFile(resolve(root, 'native/freecad-naming-probe/smoke-test.mjs'), 'utf8')
|
|
assert.match(build, /0108fd4b4850cc46e625b60e53cea7a7bbe69f8d/)
|
|
assert.match(build, /73e0e60a9d6ee06851252e2071ebdd58698f8f99733903232529b3a194164435/)
|
|
assert.match(build, /90173aba5f331ac9453589833f7e5fc63c5c80a35f1600dbc71211606b1c9dbc/)
|
|
assert.doesNotMatch(build, /public\/native\/freecad-naming-probe/)
|
|
for (const callback of ['freecadNamingAbiVersion', 'freecadNamingCapabilitiesJson', 'freecadNamingEvidenceJson']) {
|
|
assert.match(smoke, new RegExp(callback))
|
|
}
|
|
assert.match(smoke, /productionWorkerLinked: false/)
|
|
})
|
|
|
|
test('private naming boundary checker cross-validates all authoritative status files', async () => {
|
|
const source = await readFile(resolve(root, 'scripts/check-freecad-private-naming-boundary.mjs'), 'utf8')
|
|
for (const path of [
|
|
'config/freecad-sketcher-partdesign-abi-contract.json',
|
|
'config/compatibility-matrix.json',
|
|
'config/freecad-web-exact-parity-plan.json',
|
|
]) assert.match(source, new RegExp(path.replaceAll('.', '\\.')))
|
|
assert.match(source, /shippedWorkerImplementation !== 'not-linked'/)
|
|
assert.match(source, /task\.status !== 'in_progress'/)
|
|
assert.match(source, /systemExactEvaluation\?\.exact !== false/)
|
|
})
|