test: add tests for electron fuses (#42147)
* spec: add tests for electron fuses Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * spec: fix tests for windows Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * spec: handle weird crash codes on win32 Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> * spec: disable fuse tests on arm64 windows Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org>
This commit is contained in:
parent
7294c766ac
commit
ea3001dd39
9 changed files with 1080 additions and 38 deletions
|
@ -1,6 +1,5 @@
|
|||
import * as cp from 'node:child_process';
|
||||
import * as fs from 'fs-extra';
|
||||
import * as os from 'node:os';
|
||||
import * as path from 'node:path';
|
||||
import { expect } from 'chai';
|
||||
|
||||
|
@ -32,7 +31,7 @@ export function getCodesignIdentity () {
|
|||
return identity;
|
||||
}
|
||||
|
||||
export async function copyApp (newDir: string, fixture: string | null = 'initial') {
|
||||
export async function copyMacOSFixtureApp (newDir: string, fixture: string | null = 'initial') {
|
||||
const appBundlePath = path.resolve(process.execPath, '../../..');
|
||||
const newPath = path.resolve(newDir, 'Electron.app');
|
||||
cp.spawnSync('cp', ['-R', appBundlePath, path.dirname(newPath)]);
|
||||
|
@ -86,14 +85,3 @@ export function spawn (cmd: string, args: string[], opts: any = {}) {
|
|||
export function signApp (appPath: string, identity: string) {
|
||||
return spawn('codesign', ['-s', identity, '--deep', '--force', appPath]);
|
||||
};
|
||||
|
||||
export async function withTempDirectory (fn: (dir: string) => Promise<void>, autoCleanUp = true) {
|
||||
const dir = await fs.mkdtemp(path.resolve(os.tmpdir(), 'electron-update-spec-'));
|
||||
try {
|
||||
await fn(dir);
|
||||
} finally {
|
||||
if (autoCleanUp) {
|
||||
cp.spawnSync('rm', ['-r', dir]);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue