Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

test(viewport): build legacy editors through the portable CLI launcher

yhh48631844c531
diff --git a/tools/verify-gizmo-legacy-2d.mjs b/tools/verify-gizmo-legacy-2d.mjs
index be6fc9cfe..2f6e08c2c 100644
--- a/tools/verify-gizmo-legacy-2d.mjs
+++ b/tools/verify-gizmo-legacy-2d.mjs
@@ -7,6 +7,7 @@ import { execFileSync } from 'node:child_process';
import { fileURLToPath } from 'node:url';
import { runElectron } from './lib/electronRun.mjs';
import { compareLegacyGizmoFrames } from './lib/gizmoLegacyCompare.mjs';
+import { runTool } from './lib/runTool.mjs';
if (process.argv[2] === '--compare-only') {
console.log(JSON.stringify(compareLegacyGizmoFrames(path.resolve(process.argv[3])), null, 2));
@@ -38,10 +39,11 @@ const records = [];
const build = revision => {
git(['-c', 'core.hooksPath=' + (process.platform === 'win32' ? 'NUL' : '/dev/null'),
'checkout', '--detach', revision], desktop);
- const log = execFileSync('pnpm', ['--dir', 'desktop', 'exec', 'vite', 'build'], {
+ const result = runTool('pnpm', ['--dir', 'desktop', 'exec', 'vite', 'build'], {
cwd: root, encoding: 'utf8', windowsHide: true, maxBuffer: 32 * 1024 * 1024,
});
- fs.writeFileSync(path.join(out, revision + '-build.log'), log);
+ fs.writeFileSync(path.join(out, revision + '-build.log'), (result.stdout ?? '') + '\n' + (result.stderr ?? ''));
+ assert.equal(result.status, 0, result.stderr);
};
try {
for (const [label, revision] of [['baseline', baseline], ['current', original]]) {