title: How do I execute `cargo bench` on a per-file basis?
body: <p>I'm working through <a href="https://projecteuler.net" rel="nofollow noreferrer">Project Euler</a> problems, and I have each problem in a different file.  As I try different approaches to each problem, I create a series of benchmarks for each problem in its respective file.</p>
  
  <p>My directory structure looks like:</p>
  
  <pre class="lang-none prettyprint-override"><code>euler/
      Cargo.lock
      Cargo.toml
      README.md
      src/
          main.rs
          p001.rs
          p002.rs
          ...etc.
  </code></pre>
  
  <p>The contents of <code>main.rs</code> are:</p>
  
  <pre><code>#![feature(test)]
  
  extern crate primes;
  extern crate test;
  
  mod p001;
  mod p002;
  // ... etc
  
  fn main() {}
  </code></pre>
  
  <p>When I run <code>cargo bench</code>, it runs the benchmarks for every single file in my project:</p>
  
  <pre class="lang-none prettyprint-override"><code>$ cargo bench
      Finished release [optimized] target(s) in 0.02 secs
       Running target/release/deps/euler_rust-5be87dff38a04da2
  
  running 11 tests
  test p001::bench_fold_sum                     ... bench:      12,955 ns/iter (+/- 13,501)
  test p001::bench_for_sum                      ... bench:      11,385 ns/iter (+/- 7,383)
  test p002::bench_for_sum                      ... bench:         270 ns/iter (+/- 90)
  test p002::bench_takewhile_filter_mutable_sum ... bench:         322 ns/iter (+/- 333)
  test p002::bench_takewhile_filter_sum         ... bench:         512 ns/iter (+/- 379)
  test p002::bench_takewhile_sum                ... bench:         273 ns/iter (+/- 117)
  test p002::bench_while_sum                    ... bench:         286 ns/iter (+/- 240)
  </code></pre>
  
  <p>I'm interested in only running the benchmarks contained in one file, but specifying the filename after <code>cargo bench</code> yields the following:</p>
  
  <pre class="lang-none prettyprint-override"><code>$ cargo bench src/p002.rs
      Finished release [optimized] target(s) in 0.02 secs
       Running target/release/deps/euler_rust-5be87dff38a04da2
  
  running 0 tests
  
  test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 11 filtered out
  </code></pre>
  
  <p>How do you run the benchmarks in a single file?</p>