Skip to content

Commit 6e5c2a4

Browse files
committed
Remove must_succede test macro parameter
This simplifes handling of test results.
1 parent a0e00d3 commit 6e5c2a4

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

test/test-manager/src/summary.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,7 @@ pub async fn print_summary_table<P: AsRef<Path>>(summary_files: &[P]) {
250250
for test in &tests {
251251
println!("<tr>");
252252

253-
println!(
254-
"<td>{}{}</td>",
255-
test.name,
256-
if test.must_succeed { " *" } else { "" }
257-
);
253+
println!("<td>{}</td>", test.name,);
258254

259255
let mut failed_platforms = vec![];
260256
for summary in &summaries {

test/test-manager/src/tests/test_metadata.rs

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub struct TestMetadata {
99
pub func: TestWrapperFunction,
1010
pub priority: Option<i32>,
1111
pub always_run: bool,
12-
pub must_succeed: bool,
1312
}
1413

1514
impl TestMetadata {

test/test-manager/test_macro/src/lib.rs

+2-15
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ use test_rpc::meta::Os;
2323
/// * `priority` - The order in which tests will be run where low numbers run before high numbers
2424
/// and tests with the same number run in undefined order. `priority` defaults to 0.
2525
///
26-
/// * `must_succeed` - If the testing suite stops running if this test fails. `must_succeed`
27-
/// defaults to false.
28-
///
2926
/// * `always_run` - If the test should always run regardless of what test filters are provided by
3027
/// the user. `always_run` defaults to false.
3128
///
@@ -51,10 +48,10 @@ use test_rpc::meta::Os;
5148
///
5249
/// ## Create a test with custom parameters
5350
///
54-
/// This test will run early in the test loop and must succeed and will always run.
51+
/// This test will run early in the test loop and will always run.
5552
///
5653
/// ```ignore
57-
/// #[test_function(priority = -1337, must_succeed = true, always_run = true)]
54+
/// #[test_function(priority = -1337, always_run = true)]
5855
/// pub async fn test_function(
5956
/// rpc: ServiceClient,
6057
/// mut mullvad_client: mullvad_management_interface::MullvadProxyClient,
@@ -109,7 +106,6 @@ fn parse_marked_test_function(
109106
fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroParameters> {
110107
let mut priority = None;
111108
let mut always_run = false;
112-
let mut must_succeed = false;
113109
let mut targets = vec![];
114110

115111
for attribute in attributes {
@@ -129,11 +125,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar
129125
Lit::Bool(lit_bool) => always_run = lit_bool.value(),
130126
_ => bail!(nv, "'always_run' should have a bool value"),
131127
}
132-
} else if nv.path.is_ident("must_succeed") {
133-
match lit {
134-
Lit::Bool(lit_bool) => must_succeed = lit_bool.value(),
135-
_ => bail!(nv, "'must_succeed' should have a bool value"),
136-
}
137128
} else if nv.path.is_ident("target_os") {
138129
let Lit::Str(lit_str) = lit else {
139130
bail!(nv, "'target_os' should have a string value");
@@ -157,7 +148,6 @@ fn get_test_macro_parameters(attributes: &syn::AttributeArgs) -> Result<MacroPar
157148
Ok(MacroParameters {
158149
priority,
159150
always_run,
160-
must_succeed,
161151
targets,
162152
})
163153
}
@@ -176,7 +166,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream {
176166
.collect();
177167

178168
let always_run = test_function.macro_parameters.always_run;
179-
let must_succeed = test_function.macro_parameters.must_succeed;
180169

181170
let func_name = test_function.name;
182171
let function_mullvad_version = test_function.function_parameters.mullvad_client.version();
@@ -219,7 +208,6 @@ fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream {
219208
func: #wrapper_closure,
220209
priority: #test_function_priority,
221210
always_run: #always_run,
222-
must_succeed: #must_succeed,
223211
});
224212
}
225213
}
@@ -233,7 +221,6 @@ struct TestFunction {
233221
struct MacroParameters {
234222
priority: Option<i32>,
235223
always_run: bool,
236-
must_succeed: bool,
237224
targets: Vec<Os>,
238225
}
239226

0 commit comments

Comments
 (0)