줄바꿈을 LF로 통일
서버에서 바로 빌드하고 고칠 수 있게 저장소 줄바꿈을 LF로 맞췄습니다. CRLF로 들어가 있던 sh 빌드 스크립트도 이제 리눅스에서 그대로 돌아갑니다. 내용은 바뀌지 않았습니다.
This commit is contained in:
1 parent
40615838ac
commit
2d48091205
623 files changed
+501372
-501365
No files matched your search
+42
-42
@@ -1,42 +1,42 @@
|
||||
// 1.7.2 test14 GPLAY: checkbox in the Menu tab sets F_GPLAY in the menu settings; off for a start device.
|
||||
// node test/ui_gplay_test.js <paradise.bin with a save> <out_dir> [tester binary for para_points]
|
||||
const { chromium } = require('playwright');
|
||||
const fs = require('fs'), path = require('path'), cp = require('child_process');
|
||||
const F = require('../src/feld.js');
|
||||
(async () => {
|
||||
const [rom, out, tester] = process.argv.slice(2);
|
||||
fs.mkdirSync(out, { recursive: true });
|
||||
let bad = 0; const ok = (c, m) => { console.log((c ? 'ok ' : 'FAIL ') + m); if (!c) bad++; };
|
||||
const tpl = new Uint8Array(fs.readFileSync(__dirname + '/../feld/stub_feld_tpl.bin'));
|
||||
const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1280, height: 1000 }, acceptDownloads: true });
|
||||
const errors = []; p.on('pageerror', (e) => errors.push(e.message));
|
||||
await p.goto('file://' + path.resolve(__dirname, '../dist/ParamixStudio.html'));
|
||||
await p.setInputFiles('#fileRom', rom); await p.waitForSelector('#work.on', { timeout: 60000 }); await p.waitForTimeout(1500);
|
||||
await p.click('.tab[data-tab="feld"]'); await p.waitForTimeout(300);
|
||||
ok(!(await p.isDisabled('#gplayOn')), 'checkbox usable in a Paradise ROM');
|
||||
await p.check('#gplayOn'); await p.waitForTimeout(300);
|
||||
await p.screenshot({ path: out + '/gplay.png' });
|
||||
const [dl] = await Promise.all([p.waitForEvent('download', { timeout: 300000 }), p.click('#btnSave')]);
|
||||
const f = out + '/gplay.bin'; await dl.saveAs(f);
|
||||
const r = new Uint8Array(fs.readFileSync(f)), ff = F.feldFind(r, tpl);
|
||||
ok(ff && (ff.flags & F.F_GPLAY), 'flag in the menu settings: ' + (ff && ff.flags));
|
||||
// read back: checkbox stays on
|
||||
await p.setInputFiles('#fileRom', f); await p.waitForSelector('#work.on', { timeout: 60000 }); await p.waitForTimeout(1500);
|
||||
await p.click('.tab[data-tab="feld"]'); await p.waitForTimeout(300);
|
||||
ok(await p.isChecked('#gplayOn'), 'read back: on');
|
||||
await p.check('#launchOn'); await p.waitForTimeout(300);
|
||||
ok(await p.isDisabled('#gplayOn') && !(await p.isChecked('#gplayOn')), 'start device: off and greyed');
|
||||
if (tester) {
|
||||
const o2 = out + '/after.bin'; const money = (x) => { const c = ff.off + 0x140, mo = x[c + 260] | x[c + 261] << 8; return (x[0xEFE000 + mo] | x[0xEFE000 + mo + 1] << 8 | x[0xEFE000 + mo + 2] << 16) >>> 0; };
|
||||
const m0 = money(r);
|
||||
console.log(cp.execFileSync(tester, [f, '185', o2]).toString().trim());
|
||||
const r2 = new Uint8Array(fs.readFileSync(o2));
|
||||
ok(money(r2) === Math.min(99999, m0 + 30), 'points ' + m0 + ' -> ' + money(r2));
|
||||
ok(Buffer.from(r2.subarray(0xEFE000, 0xEFF000)).equals(Buffer.from(r2.subarray(0xEFF000, 0xF00000))), 'both copies the same');
|
||||
const SV = require('../src/saves.js'), crc = SV.crc16arc(r2.subarray(0xEFE000, 0xEFF000).subarray(4), 0);
|
||||
let diff = 0; for (let i = 0xEFE004; i < 0xEFF000; i++) if (r2[i] !== r[i]) diff++;
|
||||
ok(diff <= 4, 'only the money changed (' + diff + ' bytes)');
|
||||
}
|
||||
ok(!errors.length, 'no page errors ' + errors.join('; '));
|
||||
await b.close(); console.log(bad ? bad + ' FAILED' : 'all good'); process.exit(bad ? 1 : 0);
|
||||
})();
|
||||
// 1.7.2 test14 GPLAY: checkbox in the Menu tab sets F_GPLAY in the menu settings; off for a start device.
|
||||
// node test/ui_gplay_test.js <paradise.bin with a save> <out_dir> [tester binary for para_points]
|
||||
const { chromium } = require('playwright');
|
||||
const fs = require('fs'), path = require('path'), cp = require('child_process');
|
||||
const F = require('../src/feld.js');
|
||||
(async () => {
|
||||
const [rom, out, tester] = process.argv.slice(2);
|
||||
fs.mkdirSync(out, { recursive: true });
|
||||
let bad = 0; const ok = (c, m) => { console.log((c ? 'ok ' : 'FAIL ') + m); if (!c) bad++; };
|
||||
const tpl = new Uint8Array(fs.readFileSync(__dirname + '/../feld/stub_feld_tpl.bin'));
|
||||
const b = await chromium.launch(); const p = await b.newPage({ viewport: { width: 1280, height: 1000 }, acceptDownloads: true });
|
||||
const errors = []; p.on('pageerror', (e) => errors.push(e.message));
|
||||
await p.goto('file://' + path.resolve(__dirname, '../dist/ParamixStudio.html'));
|
||||
await p.setInputFiles('#fileRom', rom); await p.waitForSelector('#work.on', { timeout: 60000 }); await p.waitForTimeout(1500);
|
||||
await p.click('.tab[data-tab="feld"]'); await p.waitForTimeout(300);
|
||||
ok(!(await p.isDisabled('#gplayOn')), 'checkbox usable in a Paradise ROM');
|
||||
await p.check('#gplayOn'); await p.waitForTimeout(300);
|
||||
await p.screenshot({ path: out + '/gplay.png' });
|
||||
const [dl] = await Promise.all([p.waitForEvent('download', { timeout: 300000 }), p.click('#btnSave')]);
|
||||
const f = out + '/gplay.bin'; await dl.saveAs(f);
|
||||
const r = new Uint8Array(fs.readFileSync(f)), ff = F.feldFind(r, tpl);
|
||||
ok(ff && (ff.flags & F.F_GPLAY), 'flag in the menu settings: ' + (ff && ff.flags));
|
||||
// read back: checkbox stays on
|
||||
await p.setInputFiles('#fileRom', f); await p.waitForSelector('#work.on', { timeout: 60000 }); await p.waitForTimeout(1500);
|
||||
await p.click('.tab[data-tab="feld"]'); await p.waitForTimeout(300);
|
||||
ok(await p.isChecked('#gplayOn'), 'read back: on');
|
||||
await p.check('#launchOn'); await p.waitForTimeout(300);
|
||||
ok(await p.isDisabled('#gplayOn') && !(await p.isChecked('#gplayOn')), 'start device: off and greyed');
|
||||
if (tester) {
|
||||
const o2 = out + '/after.bin'; const money = (x) => { const c = ff.off + 0x140, mo = x[c + 260] | x[c + 261] << 8; return (x[0xEFE000 + mo] | x[0xEFE000 + mo + 1] << 8 | x[0xEFE000 + mo + 2] << 16) >>> 0; };
|
||||
const m0 = money(r);
|
||||
console.log(cp.execFileSync(tester, [f, '185', o2]).toString().trim());
|
||||
const r2 = new Uint8Array(fs.readFileSync(o2));
|
||||
ok(money(r2) === Math.min(99999, m0 + 30), 'points ' + m0 + ' -> ' + money(r2));
|
||||
ok(Buffer.from(r2.subarray(0xEFE000, 0xEFF000)).equals(Buffer.from(r2.subarray(0xEFF000, 0xF00000))), 'both copies the same');
|
||||
const SV = require('../src/saves.js'), crc = SV.crc16arc(r2.subarray(0xEFE000, 0xEFF000).subarray(4), 0);
|
||||
let diff = 0; for (let i = 0xEFE004; i < 0xEFF000; i++) if (r2[i] !== r[i]) diff++;
|
||||
ok(diff <= 4, 'only the money changed (' + diff + ' bytes)');
|
||||
}
|
||||
ok(!errors.length, 'no page errors ' + errors.join('; '));
|
||||
await b.close(); console.log(bad ? bad + ' FAILED' : 'all good'); process.exit(bad ? 1 : 0);
|
||||
})();
|
||||
Reference in new issue
Block a user