mirror of
https://github.com/msojocs/wx-compiler.git
synced 2025-07-19 00:00:04 +08:00
* fix: wine environment * fix: wine environment * fix: environment * perf: remove recommend * fix: env * Update release.yml * fix: permission of wcsc.exe * fix: 一处越界问题 * fix: pnpm install * fix: wine prepare * fix: wine cfg * feat: error console * fix: 兼容clang * perf: 调整位置 * perf: 带入环境 * fix: version * perf: log * fix: version check * fix: version
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
|
|
import assert from 'assert';
|
|
import path from 'path';
|
|
import linux from '../../../runner/binary-linux'
|
|
import windows from '../../../runner/binary-windows'
|
|
import * as fs from 'fs'
|
|
|
|
describe("wcc - empty", function () {
|
|
describe("Empty: default command output", function () {
|
|
it("版本", async function () {
|
|
const projectPath = __dirname;
|
|
const args: string[] = [
|
|
"-v"
|
|
];
|
|
let w = ""
|
|
try
|
|
{
|
|
w = (await windows.wcc(args, projectPath)).replace(/\r\n/g, '\n')
|
|
}
|
|
catch(err: any){
|
|
console.error('error:', err)
|
|
w = err.stdout.replace(/\r\n/g, '\n')
|
|
}
|
|
const n = await linux.wcc(args, projectPath);
|
|
const storagePath = path.resolve(
|
|
__dirname,
|
|
`version/${this.test?.title}`
|
|
);
|
|
try {
|
|
fs.mkdirSync(storagePath, { recursive: true });
|
|
} catch (error) {}
|
|
|
|
fs.writeFileSync(`${storagePath}/wine-output.js`, w);
|
|
fs.writeFileSync(`${storagePath}/node-output.js`, n);
|
|
assert.equal(n, w, `wine: ${w}\n\nlinux: ${n}`);
|
|
});
|
|
});
|
|
});
|