diff --git a/moz-webgpu-cts/src/main.rs b/moz-webgpu-cts/src/main.rs index 1cffaa9..6271719 100644 --- a/moz-webgpu-cts/src/main.rs +++ b/moz-webgpu-cts/src/main.rs @@ -29,7 +29,7 @@ use std::{ use crate::wpt::path::Browser; use camino::Utf8PathBuf; use clap::{Parser, ValueEnum}; -use enumset::EnumSetType; +use enumset::{EnumSet, EnumSetType}; use format::lazy_format; use indexmap::{IndexMap, IndexSet}; use itertools::Itertools; @@ -84,9 +84,10 @@ enum Subcommand { /// The heuristic for resolving differences between current metadata and processed reports. #[clap(long, default_value = "reset-contradictory")] preset: UpdateExpectedPreset, - /// The `implementation-status` that changes should be applied to. - #[clap(value_enum, long, default_value_t = ImplementationStatus::Backlog)] - implementation_status: ImplementationStatus, + /// `implementation-status`es that changes should be applied to. If not specified, defaults + /// to `implementing`. + #[clap(value_enum, long)] + implementation_status: Vec, }, /// Parse test metadata, apply automated fixups, and re-emit it in normalized form. #[clap(name = "fixup", alias = "fmt")] @@ -291,16 +292,23 @@ fn run(cli: Cli) -> ExitCode { exec_report_spec, preset, implementation_status, - } => match process_reports( - browser, - &checkout, - exec_report_spec, - preset.into(), - implementation_status, - ) { - Ok(()) => ExitCode::SUCCESS, - Err(AlreadyReportedToCommandline) => ExitCode::FAILURE, - }, + } => { + let implementation_status = if implementation_status.is_empty() { + ImplementationStatus::default().into() + } else { + EnumSet::from_iter(implementation_status) + }; + match process_reports( + browser, + &checkout, + exec_report_spec, + preset.into(), + implementation_status, + ) { + Ok(()) => ExitCode::SUCCESS, + Err(AlreadyReportedToCommandline) => ExitCode::FAILURE, + } + } Subcommand::Fixup => { log::info!("fixing up metadata in-placeā€¦"); let err_found = read_and_parse_all_metadata(browser, &checkout) @@ -1280,7 +1288,7 @@ fn process_reports( checkout: &Path, exec_report_spec: ExecReportSpec, preset: process_reports::ReportProcessingPreset, - implementation_status: ImplementationStatus, + implementation_status: EnumSet, ) -> Result<(), AlreadyReportedToCommandline> { let exec_report_paths = exec_report_spec.paths()?; diff --git a/moz-webgpu-cts/src/process_reports.rs b/moz-webgpu-cts/src/process_reports.rs index 0ea71e6..029b83d 100644 --- a/moz-webgpu-cts/src/process_reports.rs +++ b/moz-webgpu-cts/src/process_reports.rs @@ -9,7 +9,7 @@ use std::{ }; use camino::Utf8PathBuf; -use enumset::EnumSetType; +use enumset::{EnumSet, EnumSetType}; use format::lazy_format; use indexmap::IndexMap; use miette::{IntoDiagnostic, Report, WrapErr}; @@ -53,7 +53,7 @@ pub(crate) struct ProcessReportsArgs<'a> { pub checkout: &'a Path, pub exec_report_paths: Vec, pub preset: ReportProcessingPreset, - pub implementation_status: ImplementationStatus, + pub implementation_status: EnumSet, pub meta_files_by_path: IndexMap, File>, } @@ -110,7 +110,7 @@ fn reconcile( meta_props: &mut TestProps, reported: BTreeMap>>, preset: ReportProcessingPreset, - implementation_status_filter: ImplementationStatus, + implementation_status_filter: EnumSet, ) where Out: Debug + Default + EnumSetType, { diff --git a/moz-webgpu-cts/src/wpt/metadata.rs b/moz-webgpu-cts/src/wpt/metadata.rs index a710b96..818f252 100644 --- a/moz-webgpu-cts/src/wpt/metadata.rs +++ b/moz-webgpu-cts/src/wpt/metadata.rs @@ -567,7 +567,7 @@ fn format_file_properties(props: &FileProps) -> impl Display + '_ { }) } -#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Serialize, ValueEnum)] +#[derive(Debug, Default, EnumSetType, Serialize, ValueEnum)] pub enum ImplementationStatus { /// Indicates that functionality governing test(s) is implemented or currently being /// implemented, and generally expected to conform to tests.