blob: e9aa0f66fcc5b456a1d8ee56c939b37cadb0a3bc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/**
* AUTO-GENERATED - DO NOT EDIT. Source: https://github.com/gpuweb/cts
**/import { assert } from '../util/util.js';
import { parseQuery } from './query/parseQuery.js';
import { loadTreeForQuery } from './tree.js';
// A listing file, e.g. either of:
// - `src/webgpu/listing.ts` (which is dynamically computed, has a Promise<TestSuiteListing>)
// - `out/webgpu/listing.js` (which is pre-baked, has a TestSuiteListing)
// Base class for DefaultTestFileLoader and FakeTestFileLoader.
export class TestFileLoader extends EventTarget {
importSpecFile(suite, path) {
const url = `${suite}/${path.join('/')}.spec.js`;
this.dispatchEvent(
new MessageEvent('import', { data: { url } }));
return this.import(url);
}
async loadTree(query, subqueriesToExpand = []) {
const tree = await loadTreeForQuery(
this,
query,
subqueriesToExpand.map((s) => {
const q = parseQuery(s);
assert(q.level >= 2, () => `subqueriesToExpand entries should not be multi-file:\n ${q}`);
return q;
}));
this.dispatchEvent(new MessageEvent('finish'));
return tree;
}
async loadCases(query) {
const tree = await this.loadTree(query);
return tree.iterateLeaves();
}
}
export class DefaultTestFileLoader extends TestFileLoader {
async listing(suite) {
return (await import(`../../${suite}/listing.js`)).listing;
}
import(path) {
return import(`../../${path}`);
}
}
//# sourceMappingURL=file_loader.js.map
|