Skip to content

Commit 96781a6

Browse files
refactor!: use IndexMaps instead of BTreeMaps for test and subtest order
1 parent 5dcfd3e commit 96781a6

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

moz-webgpu-cts/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ clap = { version = "4.4.2", features = ["derive"] }
2323
env_logger = "0.11.7"
2424
enumset = { version = "1.1.3", features = ["serde"] }
2525
format = { workspace = true }
26-
indexmap = { workspace = true }
26+
indexmap = { workspace = true, features = ["serde"] }
2727
itertools = "0.11.0"
2828
joinery = "3.1.0"
2929
lets_find_up = "0.0.3"

moz-webgpu-cts/src/process_reports.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ where
4646
#[derive(Debug, Default)]
4747
pub(crate) struct TestEntry {
4848
pub entry: Entry<TestOutcome>,
49-
pub subtests: BTreeMap<String, Entry<SubtestOutcome>>,
49+
pub subtests: IndexMap<String, Entry<SubtestOutcome>>,
5050
}
5151

5252
#[derive(Debug)]
@@ -566,7 +566,7 @@ pub(crate) fn process_reports(
566566
},
567567
))
568568
})
569-
.collect::<BTreeMap<_, _>>();
569+
.collect::<IndexMap<_, _>>();
570570

571571
Some((test_entry_path, (properties, subtests)))
572572
},

moz-webgpu-cts/src/wpt/metadata.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use std::{
2-
collections::BTreeMap,
32
fmt::{self, Display, Formatter},
43
hash::Hash,
54
};
@@ -8,6 +7,7 @@ use clap::ValueEnum;
87
use enum_map::Enum;
98
use enumset::EnumSetType;
109
use format::lazy_format;
10+
use indexmap::IndexMap;
1111
use joinery::JoinableIterator;
1212
use maybe_collapsed::MaybeCollapsed;
1313
use serde::{Deserialize, Serialize};
@@ -42,7 +42,7 @@ pub(crate) mod properties;
4242
#[derive(Clone, Debug, Default, Serialize)]
4343
pub struct File {
4444
pub properties: FileProps,
45-
pub tests: BTreeMap<SectionHeader, Test>,
45+
pub tests: IndexMap<SectionHeader, Test>,
4646
}
4747

4848
impl File {
@@ -646,7 +646,7 @@ impl ImplementationStatus {
646646
}
647647

648648
#[derive(Debug, Default)]
649-
pub struct Tests(BTreeMap<SectionHeader, Test>);
649+
pub struct Tests(IndexMap<SectionHeader, Test>);
650650

651651
impl<'a> metadata::Tests<'a> for Tests {
652652
type Test = Test;
@@ -669,7 +669,7 @@ impl<'a> metadata::Tests<'a> for Tests {
669669
#[derive(Clone, Debug, Default, Serialize)]
670670
pub struct Test {
671671
pub properties: TestProps<TestOutcome>,
672-
pub subtests: BTreeMap<SectionHeader, Subtest>,
672+
pub subtests: IndexMap<SectionHeader, Subtest>,
673673
}
674674

675675
#[cfg(test)]
@@ -693,7 +693,7 @@ impl metadata::Test<'_> for Test {
693693
}
694694

695695
#[derive(Default)]
696-
pub struct Subtests(BTreeMap<SectionHeader, Subtest>);
696+
pub struct Subtests(IndexMap<SectionHeader, Subtest>);
697697

698698
impl<'a> metadata::Subtests<'a> for Subtests {
699699
type Subtest = Subtest;

0 commit comments

Comments
 (0)