Skip to content

Commit

Permalink
Add demo test suite, for manually testing test runners (gpuweb#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
kainino0x committed May 20, 2020
1 parent 98cfd95 commit 53eb03a
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -15,7 +15,7 @@ module.exports = function (grunt) {
},
'generate-listings': {
cmd: 'node',
args: ['tools/gen_listings', 'webgpu', 'unittests'],
args: ['tools/gen_listings', 'webgpu', 'unittests', 'demo'],
},
'generate-wpt-cts-html': {
cmd: 'node',
Expand Down
1 change: 1 addition & 0 deletions src/demo/README.txt
@@ -0,0 +1 @@
Demo test suite for manually testing test runners.
6 changes: 6 additions & 0 deletions src/demo/a.spec.ts
@@ -0,0 +1,6 @@
export const description = 'Description for a.spec.ts';

import { makeTestGroup } from '../common/framework/test_group.js';
import { UnitTest } from '../unittests/unit_test.js';

export const g = makeTestGroup(UnitTest);
1 change: 1 addition & 0 deletions src/demo/a/README.txt
@@ -0,0 +1 @@
README for a/
6 changes: 6 additions & 0 deletions src/demo/a/b.spec.ts
@@ -0,0 +1,6 @@
export const description = 'Description for b.spec.ts';

import { makeTestGroup } from '../../common/framework/test_group.js';
import { UnitTest } from '../../unittests/unit_test.js';

export const g = makeTestGroup(UnitTest);
1 change: 1 addition & 0 deletions src/demo/a/b/README.txt
@@ -0,0 +1 @@
README for a/b/
39 changes: 39 additions & 0 deletions src/demo/a/b/c.spec.ts
@@ -0,0 +1,39 @@
export const description = 'Description for c.spec.ts';

import { makeTestGroup } from '../../../common/framework/test_group.js';
import { unreachable } from '../../../common/framework/util/util.js';
import { UnitTest } from '../../../unittests/unit_test.js';

export const g = makeTestGroup(UnitTest);

g.test('f').fn(() => {});

g.test('f,g').fn(() => {});

g.test('f,g,h')
.params([{}, { x: 0 }, { x: 0, y: 0 }])
.fn(() => {});

g.test('case_depth_2_in_single_child_test')
.params([{ x: 0, y: 0 }])
.fn(() => {});

g.test('statuses,debug').fn(t => {
t.debug('debug');
});

g.test('statuses,skip').fn(t => {
t.skip('skip');
});

g.test('statuses,warn').fn(t => {
t.warn('warn');
});

g.test('statuses,fail').fn(t => {
t.fail('fail');
});

g.test('statuses,throw').fn(() => {
unreachable('unreachable');
});
8 changes: 8 additions & 0 deletions src/demo/a/b/d.spec.ts
@@ -0,0 +1,8 @@
export const description = 'Description for d.spec.ts';

import { makeTestGroup } from '../../../common/framework/test_group.js';
import { UnitTest } from '../../../unittests/unit_test.js';

export const g = makeTestGroup(UnitTest);

g.test('test_depth_2,in_single_child_file').fn(() => {});
6 changes: 6 additions & 0 deletions src/demo/file_depth_2/in_single_child_dir/r.spec.ts
@@ -0,0 +1,6 @@
export const description = 'Description for r.spec.ts';

import { makeTestGroup } from '../../../common/framework/test_group.js';
import { UnitTest } from '../../../unittests/unit_test.js';

export const g = makeTestGroup(UnitTest);

0 comments on commit 53eb03a

Please sign in to comment.