Fix build on Windows
This commit is contained in:
parent
0206834fdf
commit
cb7e03d7dd
4 changed files with 30 additions and 21 deletions
28
Gruntfile.js
28
Gruntfile.js
|
|
@ -15,23 +15,25 @@ module.exports = function(grunt) {
|
|||
|
||||
run: {
|
||||
'generate-listings': {
|
||||
cmd: 'tools/gen',
|
||||
args: ['cts', 'unittests'],
|
||||
cmd: 'node',
|
||||
args: ['tools/gen', 'cts', 'unittests'],
|
||||
},
|
||||
'generate-version': {
|
||||
cmd: 'tools/gen_version',
|
||||
cmd: 'node',
|
||||
args: ['tools/gen_version'],
|
||||
},
|
||||
test: {
|
||||
cmd: 'tools/run',
|
||||
args: ['unittests:'],
|
||||
cmd: 'node',
|
||||
args: ['tools/run', 'unittests:'],
|
||||
},
|
||||
'build-out': {
|
||||
cmd: 'node_modules/.bin/babel',
|
||||
args: ['--source-maps', 'true', '--extensions', '.ts', '--out-dir', 'out/', 'src/'],
|
||||
cmd: 'node',
|
||||
args: ['node_modules/@babel/cli/bin/babel', '--source-maps', 'true', '--extensions', '.ts', '--out-dir', 'out/', 'src/'],
|
||||
},
|
||||
'build-shaderc': {
|
||||
cmd: 'node_modules/.bin/babel',
|
||||
cmd: 'node',
|
||||
args: [
|
||||
'node_modules/@babel/cli/bin/babel',
|
||||
'--plugins',
|
||||
'babel-plugin-transform-commonjs-es2015-modules',
|
||||
'node_modules/@webgpu/shaderc/dist/index.js',
|
||||
|
|
@ -39,8 +41,14 @@ module.exports = function(grunt) {
|
|||
'out/shaderc.js',
|
||||
],
|
||||
},
|
||||
'gts-check': { cmd: 'node_modules/.bin/gts', args: ['check'] },
|
||||
'gts-fix': { cmd: 'node_modules/.bin/gts', args: ['fix'] },
|
||||
'gts-check': {
|
||||
cmd: 'node',
|
||||
args: ['node_modules/gts/build/src/cli', 'check'],
|
||||
},
|
||||
'gts-fix': {
|
||||
cmd: 'node',
|
||||
args: ['node_modules/gts/build/src/cli', 'fix'],
|
||||
},
|
||||
},
|
||||
|
||||
copy: {
|
||||
|
|
|
|||
|
|
@ -10,9 +10,10 @@ export function getStackTrace(e: Error): string {
|
|||
|
||||
const stack = [];
|
||||
let found = false;
|
||||
const suitesRegex = /[\/\\]suites[\/\\]/;
|
||||
for (let i = 0; i < parts.length; ++i) {
|
||||
const part = parts[i].trim();
|
||||
const isSuites = part.indexOf('/suites/') !== -1;
|
||||
const isSuites = suitesRegex.test(part);
|
||||
if (found && !isSuites) {
|
||||
break;
|
||||
}
|
||||
|
|
@ -28,21 +29,21 @@ export function getStackTrace(e: Error): string {
|
|||
// *** Examples ***
|
||||
//
|
||||
// Node fail()
|
||||
// x Error:
|
||||
// x at CaseRecorder.fail (/Users/kainino/src/cts-experiment/src/framework/logger.ts:99:30)
|
||||
// > Error:
|
||||
// > at CaseRecorder.fail (/Users/kainino/src/cts-experiment/src/framework/logger.ts:99:30)
|
||||
// > at RunCaseSpecific.exports.g.test.t [as fn] (/Users/kainino/src/cts-experiment/src/suites/unittests/logger.spec.ts:80:7)
|
||||
// x at RunCaseSpecific.run (/Users/kainino/src/cts-experiment/src/framework/test_group.ts:121:18)
|
||||
// x at processTicksAndRejections (internal/process/task_queues.js:86:5)
|
||||
//
|
||||
// Node throw
|
||||
// x Error: hello
|
||||
// > Error: hello
|
||||
// > at RunCaseSpecific.g.test.t [as fn] (/Users/kainino/src/cts-experiment/src/suites/unittests/test_group.spec.ts:51:11)
|
||||
// x at RunCaseSpecific.run (/Users/kainino/src/cts-experiment/src/framework/test_group.ts:121:18)
|
||||
// x at processTicksAndRejections (internal/process/task_queues.js:86:5)
|
||||
//
|
||||
// Firefox fail()
|
||||
// x fail@http://localhost:8080/out/framework/logger.js:104:30
|
||||
// x expect@http://localhost:8080/out/framework/default_fixture.js:59:16
|
||||
// > fail@http://localhost:8080/out/framework/logger.js:104:30
|
||||
// > expect@http://localhost:8080/out/framework/default_fixture.js:59:16
|
||||
// > @http://localhost:8080/out/suites/unittests/util.spec.js:35:5
|
||||
// x run@http://localhost:8080/out/framework/test_group.js:119:18
|
||||
//
|
||||
|
|
@ -51,8 +52,8 @@ export function getStackTrace(e: Error): string {
|
|||
// x run@http://localhost:8080/out/framework/test_group.js:119:18
|
||||
//
|
||||
// Safari fail()
|
||||
// x fail@http://localhost:8080/out/framework/logger.js:104:39
|
||||
// x expect@http://localhost:8080/out/framework/default_fixture.js:59:20
|
||||
// > fail@http://localhost:8080/out/framework/logger.js:104:39
|
||||
// > expect@http://localhost:8080/out/framework/default_fixture.js:59:20
|
||||
// > http://localhost:8080/out/suites/unittests/util.spec.js:35:11
|
||||
// x http://localhost:8080/out/framework/test_group.js:119:20
|
||||
// x asyncFunctionResume@[native code]
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ g.test('stack', async t0 => {
|
|||
|
||||
const res = await t0.run(g);
|
||||
|
||||
const search = /unittests\/test_group\.spec\.[tj]s|suites\/unittests\/unit_test\.[tj]s/;
|
||||
const search = /unittests[\/\\]test_group\.spec\.[tj]s|suites[\/\\]unittests[\/\\]unit_test\.[tj]s/;
|
||||
for (const { logs } of res.cases) {
|
||||
if (logs === undefined) {
|
||||
throw new Error('expected logs');
|
||||
|
|
|
|||
|
|
@ -13,13 +13,13 @@ import { TestSuiteListingEntry } from '../framework/listing.js';
|
|||
const specSuffix = '.spec.ts';
|
||||
|
||||
export async function crawl(suite: string): Promise<TestSuiteListingEntry[]> {
|
||||
const specDir = path.normalize(`src/suites/${suite}`);
|
||||
const specDir = 'src/suites/' + suite;
|
||||
if (!fs.existsSync(specDir)) {
|
||||
console.error(`Could not find ${specDir}`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const specFiles = await fg(specDir + '/**/{README.txt,*' + specSuffix + '}', { onlyFiles: true });
|
||||
const specFiles = await fg(specDir + '/**/*' + specSuffix, { onlyFiles: true });
|
||||
|
||||
const groups: TestSuiteListingEntry[] = [];
|
||||
for (const file of specFiles) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue