Skip to content

Commit 374a2c8

Browse files
committed
Split framework/ directory into three directories
1 parent bd30d74 commit 374a2c8

96 files changed

Lines changed: 201 additions & 188 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
{
4747
"target": "./src/webgpu",
4848
"from": "./src/common",
49-
"except": ["./framework", "./tools/crawl.ts", "./constants.ts"],
49+
"except": ["./framework", "./util", "./tools/crawl.ts", "./constants.ts"],
5050
"message": "Non-framework common/ code imported from webgpu/ suite"
5151
},
5252
{
5353
"target": "./src/unittests",
5454
"from": "./src/common",
55-
"except": ["./framework", "./tools/crawl.ts", "./constants.ts"],
55+
"except": ["./framework", "./util", "./internal", "./tools/crawl.ts", "./constants.ts"],
5656
"message": "Non-framework common/ code imported from unittests/ suite"
5757
},
5858
{

Gruntfile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = function (grunt) {
5252
'--only=src/common/runtime/wpt.ts',
5353
'--only=src/webgpu/',
5454
// These files will be generated, instead of compiled from TypeScript.
55-
'--ignore=src/common/framework/version.ts',
55+
'--ignore=src/common/internal/version.ts',
5656
'--ignore=src/webgpu/listing.ts',
5757
],
5858
},
@@ -83,7 +83,7 @@ module.exports = function (grunt) {
8383
copy: {
8484
'out-wpt-generated': {
8585
files: [
86-
{ expand: true, cwd: 'out', src: 'common/framework/version.js', dest: 'out-wpt/' },
86+
{ expand: true, cwd: 'out', src: 'common/internal/version.js', dest: 'out-wpt/' },
8787
{ expand: true, cwd: 'out', src: 'webgpu/listing.js', dest: 'out-wpt/' },
8888
],
8989
},

src/common/framework/fixture.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
import { TestCaseRecorder } from './logging/test_case_recorder.js';
2-
import { TestParams } from './params_utils.js';
3-
import { assert } from './util/util.js';
1+
import { TestCaseRecorder } from '../internal/logging/test_case_recorder.js';
2+
import { JSONWithUndefined } from '../internal/params_utils.js';
3+
import { assert } from '../util/util.js';
44

55
export class SkipTestCase extends Error {}
66
export class UnexpectedPassError extends Error {}
77

8+
export { TestCaseRecorder } from '../internal/logging/test_case_recorder.js';
9+
10+
/** The fully-general type for params passed to a test function invocation. */
11+
export type TestParams = {
12+
readonly [k: string]: JSONWithUndefined;
13+
};
14+
815
// A Fixture is a class used to instantiate each test case at run time.
916
// A new instance of the Fixture is created for every single test case
1017
// (i.e. every time the test function is run).

src/common/framework/params_builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Merged, mergeParams } from './params_utils.js';
1+
import { Merged, mergeParams } from '../internal/params_utils.js';
22

33
// ================================================================
44
// "Public" ParamsBuilder API / Documentation
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import { IterableTestGroup } from '../internal/test_group.js';
2+
import { assert } from '../util/util.js';
3+
14
import { parseQuery } from './query/parseQuery.js';
25
import { TestQuery } from './query/query.js';
3-
import { IterableTestGroup } from './test_group.js';
46
import { TestSuiteListing } from './test_suite_listing.js';
57
import { loadTreeForQuery, TestTree, TestTreeLeaf } from './tree.js';
6-
import { assert } from './util/util.js';
78

89
// A listing file, e.g. either of:
910
// - `src/webgpu/listing.ts` (which is dynamically computed, has a Promise<TestSuiteListing>)

src/common/framework/logging/log_message.ts renamed to src/common/internal/logging/log_message.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { extractImportantStackTrace } from '../util/stack.js';
1+
import { extractImportantStackTrace } from '../stack.js';
22

33
export class LogMessageWithStack extends Error {
44
private stackHidden: boolean = false;

src/common/framework/logging/test_case_recorder.ts renamed to src/common/internal/logging/test_case_recorder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { SkipTestCase, UnexpectedPassError } from '../fixture.js';
2-
import { now, assert } from '../util/util.js';
1+
import { SkipTestCase, UnexpectedPassError } from '../../framework/fixture.js';
2+
import { now, assert } from '../../util/util.js';
33

44
import { LogMessageWithStack } from './log_message.js';
55
import { Expectation, LiveTestCaseResult } from './result.js';
Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
import { TestParams } from '../framework/fixture.js';
2+
import { ResolveType, UnionToIntersection } from '../util/types.js';
3+
import { assert } from '../util/util.js';
4+
15
import { comparePublicParamsPaths, Ordering } from './query/compare.js';
26
import { kWildcard, kParamSeparator, kParamKVSeparator } from './query/separators.js';
3-
import { ResolveType, UnionToIntersection } from './util/types.js';
4-
import { assert } from './util/util.js';
57

68
export type JSONWithUndefined =
79
| undefined
@@ -12,10 +14,6 @@ export type JSONWithUndefined =
1214
| readonly JSONWithUndefined[]
1315
// Ideally this would recurse into JSONWithUndefined, but it breaks code.
1416
| { readonly [k: string]: unknown };
15-
/** The fully-general type for params passed to a test function invocation. */
16-
export type TestParams = {
17-
readonly [k: string]: JSONWithUndefined;
18-
};
1917
export interface TestParamsRW {
2018
[k: string]: JSONWithUndefined;
2119
}

0 commit comments

Comments
 (0)