0

I have a test named builtin_functions and design_variables how can I run only these two tests and nothing else.

I have naively tried cargo test builtin_functions,design_variables and cargo test builtin_functions design_variables but neither work.

What can I do?

Nils André
  • 571
  • 5
  • 17

1 Answers1

1

Unfortunately, there are only two ways of getting the behavior you specified, neither of them great. You could type

cargo test builtin_functions && cargo test design_variables

,effectively calling the function twice or you could add an apparently arbitrary prefix that only these two tests would have before you run them, such as

fn foo_builtin_functions {
   /*...*/
}
fn foo_design_variables() {
    /*...*/
}

and them simply call

cargo test foo

Which would run all tests that contain foo in their name calling both both tests synchronously, as is the default behavior, but obviously requires more forethought.

Esdeseserdt
  • 181
  • 10