Skip to content

Commit 848ca10

Browse files
committed
minimize tests.yml
1 parent f041e58 commit 848ca10

File tree

3 files changed

+9
-504
lines changed

3 files changed

+9
-504
lines changed

ci/svd2rust-regress/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub struct TestOpts {
106106

107107
impl TestOpts {
108108
fn run(&self, opt: &Opts) -> Result<(), anyhow::Error> {
109-
let tests = tests::tests(None)?
109+
let tests = tests::tests(Some(&opt.test_cases))?
110110
.iter()
111111
// Short test?
112112
.filter(|t| t.should_run(!self.long_test))

ci/svd2rust-regress/src/tests.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,10 @@ impl std::fmt::Display for Manufacturer {
5454
}
5555
}
5656

57-
#[derive(Debug, serde::Serialize, serde::Deserialize)]
57+
#[derive(Debug, serde::Serialize, serde::Deserialize, Default)]
5858
#[serde(rename_all = "kebab-case")]
5959
pub enum RunWhen {
60+
#[default]
6061
Always,
6162
NotShort,
6263

@@ -71,10 +72,16 @@ pub struct TestCase {
7172
pub chip: String,
7273
#[serde(default, skip_serializing_if = "Option::is_none")]
7374
svd_url: Option<String>,
75+
#[serde(default = "true_")]
7476
pub should_pass: bool,
77+
#[serde(default)]
7578
run_when: RunWhen,
7679
}
7780

81+
fn true_() -> bool {
82+
true
83+
}
84+
7885
impl TestCase {
7986
pub fn svd_url(&self) -> String {
8087
match &self.svd_url {

0 commit comments

Comments
 (0)