Skip to content

Commit

Permalink
Restore missing test path validation (#3129)
Browse files Browse the repository at this point in the history
* Restore missing test path validation

This fixes tools/validate so it actually does all the validation it was
supposed to do. Also deduplicates recently-introduced (benign) duplicate
subcases that it would have caught.

Accidentally regressed in #2770.

* Fix duplicate in unittest
  • Loading branch information
kainino0x authored Nov 2, 2023
1 parent eb70aaf commit d13a52a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
2 changes: 2 additions & 0 deletions src/common/tools/crawl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ export async function crawl(suiteDir: string, validate: boolean): Promise<TestSu
assert(mod.description !== undefined, 'Test spec file missing description: ' + filename);
assert(mod.g !== undefined, 'Test spec file missing TestGroup definition: ' + filename);

mod.g.validate();

for (const { testPath } of mod.g.collectNonEmptyTests()) {
const testQuery = new TestQueryMultiCase(suite, pathSegments, testPath, {}).toString();
if (validateTimingsEntries) {
Expand Down
8 changes: 0 additions & 8 deletions src/unittests/floating_point.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6437,14 +6437,6 @@ g.test('determinantInterval')
],
expected: 0,
},
{
input: [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9],
],
expected: 0,
},
{
input: [
[4, 1, -1],
Expand Down
18 changes: 8 additions & 10 deletions src/webgpu/api/operation/vertex_state/correctness.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -746,18 +746,16 @@ g.test('non_zero_array_stride_and_attribute_offset')
{ mult: 1, add: 0 },
];
})
.expand('offsetVariant', p => {
.expand('offsetVariant', function* (p) {
const formatInfo = kVertexFormatInfo[p.format];
const formatSize = formatInfo.byteSize;
return [
{ mult: 0, add: 0 },
{ mult: 0, add: formatSize },
{ mult: 0, add: 4 },
{ mult: 0.5, add: 0 },
{ mult: 1, add: -formatSize * 2 },
{ mult: 1, add: -formatSize - 4 },
{ mult: 1, add: -formatSize },
];
yield { mult: 0, add: 0 };
yield { mult: 0, add: 4 };
if (formatSize !== 4) yield { mult: 0, add: formatSize };
yield { mult: 0.5, add: 0 };
yield { mult: 1, add: -formatSize * 2 };
if (formatSize !== 4) yield { mult: 1, add: -formatSize - 4 };
yield { mult: 1, add: -formatSize };
})
)
.fn(t => {
Expand Down

0 comments on commit d13a52a

Please sign in to comment.