Skip to content

Commit 90f13ce

Browse files
committed
feat: Reorder print options
1 parent f9efb9f commit 90f13ce

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

mutest-driver-cli/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ pub mod mutant_batch_greedy_ordering_heuristic {
7272
pub mod print {
7373
crate::opts! { ALL, pub(crate) possible_values where
7474
TESTS = "tests"; ["Print list of test cases."]
75-
TARGETS = "targets"; ["Print list of functions targeted for mutation at the specified depth."]
7675
CALL_GRAPH = "call-graph"; ["Print call graph of test cases."]
77-
CONFLICT_GRAPH = "conflict-graph"; ["Print mutation conflict graph."]
78-
COMPATIBILITY_GRAPH = "compatibility-graph"; ["Print mutation compatibility graph (i.e. the complement graph of the conflict graph)."]
76+
TARGETS = "targets"; ["Print list of functions targeted for mutation at the specified depth."]
7977
MUTATIONS = "mutations"; ["Print list of generated mutations, optionally grouped into mutation batches."]
78+
CONFLICT_GRAPH = "conflict-graph"; ["Print mutation conflict graph."]
79+
COMPATIBILITY_GRAPH = "compatibility-graph"; ["Print mutation compatibility graph (i.e., the complement graph of the conflict graph)."]
8080
CODE = "code"; ["Print the generated code of the test harness."]
8181
}
8282
}

mutest-driver/src/config.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,21 +83,21 @@ pub struct ConflictGraphOptions {
8383
pub struct PrintOptions {
8484
pub print_headers: bool,
8585
pub tests: Option<()>,
86-
pub mutation_targets: Option<()>,
8786
pub call_graph: Option<CallGraphOptions>,
88-
pub conflict_graph: Option<ConflictGraphOptions>,
87+
pub mutation_targets: Option<()>,
8988
pub mutations: Option<()>,
89+
pub conflict_graph: Option<ConflictGraphOptions>,
9090
pub code: Option<()>,
9191
}
9292

9393
impl PrintOptions {
9494
pub fn is_empty(&self) -> bool {
9595
true
9696
&& self.tests.is_none()
97-
&& self.mutation_targets.is_none()
9897
&& self.call_graph.is_none()
99-
&& self.conflict_graph.is_none()
98+
&& self.mutation_targets.is_none()
10099
&& self.mutations.is_none()
100+
&& self.conflict_graph.is_none()
101101
&& self.code.is_none()
102102
}
103103
}

mutest-driver/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ pub fn main() {
289289
let mut print_opts = config::PrintOptions {
290290
print_headers: print_names.len() > 1,
291291
tests: None,
292-
mutation_targets: None,
293292
call_graph: None,
294-
conflict_graph: None,
293+
mutation_targets: None,
295294
mutations: None,
295+
conflict_graph: None,
296296
code: None,
297297
};
298298

@@ -309,7 +309,6 @@ pub fn main() {
309309
for print_name in print_names {
310310
match print_name {
311311
opts::TESTS => print_opts.tests = Some(()),
312-
opts::TARGETS => print_opts.mutation_targets = Some(()),
313312
opts::CALL_GRAPH => {
314313
let entry_point_filters = mutest_arg_matches.get_many::<String>("call-graph-filter-entry-points").map(|s| s.map(|f| f.trim().to_owned()).collect::<Vec<_>>()).unwrap_or_default();
315314
let non_local_call_view = {
@@ -322,12 +321,13 @@ pub fn main() {
322321
};
323322
print_opts.call_graph = Some(config::CallGraphOptions { format: graph_format, entry_point_filters, non_local_call_view });
324323
}
324+
opts::TARGETS => print_opts.mutation_targets = Some(()),
325+
opts::MUTATIONS => print_opts.mutations = Some(()),
325326
opts::CONFLICT_GRAPH | opts::COMPATIBILITY_GRAPH => {
326327
let compatibility_graph = matches!(print_name, opts::COMPATIBILITY_GRAPH);
327328
let exclude_unsafe = mutest_arg_matches.get_flag("graph-exclude-unsafe");
328329
print_opts.conflict_graph = Some(config::ConflictGraphOptions { compatibility_graph, exclude_unsafe, format: graph_format });
329330
}
330-
opts::MUTATIONS => print_opts.mutations = Some(()),
331331
opts::CODE => print_opts.code = Some(()),
332332
_ => unreachable!("invalid print information name: `{print_name}`"),
333333
}

0 commit comments

Comments
 (0)