We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 28c7a25 commit b808eabCopy full SHA for b808eab
src/librustc/front/test.rs
@@ -29,7 +29,13 @@ type test_ctxt =
29
fn modify_for_testing(sess: session::Session,
30
crate: @ast::crate) -> @ast::crate {
31
32
- if sess.opts.test {
+ // We generate the test harness when building in the 'test'
33
+ // configuration, either with the '--test' or '--cfg test'
34
+ // command line options.
35
+ let should_test = attr::contains(crate.node.config,
36
+ attr::mk_word_item(~"test"));
37
+
38
+ if should_test {
39
generate_test_harness(sess, crate)
40
} else {
41
strip_test_functions(crate)
0 commit comments