Complete M16 driver button add parity
This commit is contained in:
@@ -3617,22 +3617,25 @@ if (task === "M16-GAP-00174") {
|
||||
const fixture = path.join(root, "tests/files/web/generated/M16-GAP-00174-operator-anim.driver_button_add.blend");
|
||||
const desktopPath = path.join(root, "tests/golden/M16-GAP-00174/anim-driver-button-add-desktop-report.json");
|
||||
fs.mkdirSync(path.dirname(desktopPath), { recursive: true });
|
||||
const run = spawnSync(process.env.BLENDER_BIN ?? path.join(root, "build_blender_5.2.0/bin/blender"), ["-b", "--factory-startup", "--python", path.join(root, "tools/web/check-action-driver-button-add-desktop.py"), "--", fixture, desktopPath], { cwd: root, encoding: "utf8", maxBuffer: 8 * 1024 * 1024 });
|
||||
const blender = process.env.BLENDER_BIN ?? path.join(root, "build_blender_5.2.0/bin/blender");
|
||||
const checker = path.join(root, "tools/web/check-action-driver-button-add-desktop.py");
|
||||
const foregroundArgs = ["-a", "--server-args=-screen 0 1280x800x24", blender, "--factory-startup", "--python", checker, "--", fixture, desktopPath];
|
||||
const run = spawnSync(process.env.XVFB_RUN_BIN ?? "xvfb-run", foregroundArgs, { cwd: root, encoding: "utf8", maxBuffer: 8 * 1024 * 1024, timeout: 45_000 });
|
||||
assert.equal(run.status, 0, `${run.stdout ?? ""}\n${run.stderr ?? ""}`);
|
||||
assert.equal(fs.existsSync(desktopPath), true, `${run.stdout ?? ""}\n${run.stderr ?? ""}`);
|
||||
const desktop = JSON.parse(fs.readFileSync(desktopPath, "utf8"));
|
||||
assert.equal(desktop.saveReopen, "EXACT");
|
||||
assert.equal(desktop.mainMutation, "NONE");
|
||||
assert.equal(desktop.poll, false);
|
||||
assert.equal(desktop.operatorStatus, "CANCELLED");
|
||||
assert.deepEqual(desktop.drivers, []);
|
||||
assert.equal(desktop.mainMutation, "DRIVER_ADDED");
|
||||
assert.equal(desktop.poll, true);
|
||||
assert.equal(desktop.operatorStatus, "FINISHED");
|
||||
assert.deepEqual(desktop.drivers, [{ path: '["drive_target"]', index: 0, expression: "var + 4.5", type: "SCRIPTED", variableCount: 1 }]);
|
||||
const engine = await factory({ wasmBinary });
|
||||
const handle = engine._web_engine_create();
|
||||
open(engine, handle, fs.readFileSync(fixture));
|
||||
const before = snapshot(engine, handle);
|
||||
const node = before.nodes?.find((value) => value.id === "object:WebGapAnimDriverButtonAddObject");
|
||||
assert.ok(node);
|
||||
assert.equal(node.drivers, undefined);
|
||||
assert.deepEqual(node.drivers, [{ path: '["drive_target"]', arrayIndex: 0, editable: true, enabled: true, expression: "var + 4.5", type: "SCRIPTED", typeCode: 1, flags: 16, influence: 0, variables: [{ name: "var", type: 3, targetCount: 1 }] }]);
|
||||
const saved = output(engine, handle, engine._web_engine_save_blend, true);
|
||||
const reopened = engine._web_engine_create();
|
||||
open(engine, reopened, saved);
|
||||
@@ -3646,10 +3649,10 @@ if (task === "M16-GAP-00174") {
|
||||
assert.deepEqual(snapshot(engine, handle).nodes?.find((value) => value.id === node.id), node);
|
||||
engine._web_engine_destroy(handle);
|
||||
engine._web_engine_destroy(reopened);
|
||||
const report = { schemaVersion: 1, task, operation: "ANIM_DRIVER_BUTTON_ADD_LOCAL_EXACT", fixture: { path: path.relative(root, fixture).replaceAll(path.sep, "/"), sha256: desktop.fixtureSha256 }, desktop: { status: "EXACT", report: path.relative(root, desktopPath).replaceAll(path.sep, "/"), saveReopen: desktop.saveReopen, poll: desktop.poll, operatorStatus: desktop.operatorStatus, mainMutation: desktop.mainMutation }, wasm: { status: "EXACT", objectId: node.id, drivers: [] }, saveReopen: "EXACT", negative: { malformedBlend: "REJECTED_WITHOUT_MAIN_MUTATION" }, nextTask: "M16-GAP-00174" };
|
||||
const report = { schemaVersion: 1, task, operation: "ANIM_DRIVER_BUTTON_ADD_LOCAL_EXACT", fixture: { path: path.relative(root, fixture).replaceAll(path.sep, "/"), sha256: desktop.fixtureSha256 }, desktop: { status: "EXACT", report: path.relative(root, desktopPath).replaceAll(path.sep, "/"), saveReopen: desktop.saveReopen, poll: desktop.poll, operatorStatus: desktop.operatorStatus, mainMutation: desktop.mainMutation }, wasm: { status: "EXACT", objectId: node.id, drivers: node.drivers }, saveReopen: "EXACT", negative: { malformedBlend: "REJECTED_WITHOUT_MAIN_MUTATION" }, nextTask: "M16-GAP-00175" };
|
||||
const reportPath = path.join(root, "tests/golden/M16-GAP-00174/anim-driver-button-add-local-exact-report.json");
|
||||
fs.writeFileSync(reportPath, `${JSON.stringify(report, null, 2)}\n`);
|
||||
process.stdout.write(`generated-gap-ok task=${task} drivers=0 poll=false operator=${desktop.operatorStatus} mainMutation=none desktop=exact saveReopen=exact next=${report.nextTask}\n`);
|
||||
process.stdout.write(`generated-gap-ok task=${task} drivers=${node.drivers.length} poll=true operator=${desktop.operatorStatus} mainMutation=driver_added desktop=exact saveReopen=exact next=${report.nextTask}\n`);
|
||||
process.exit(0);
|
||||
}
|
||||
if (task === "M16-GAP-00027") {
|
||||
|
||||
Reference in New Issue
Block a user