about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorSeo Sanghyeon <sanxiyn@gmail.com>2016-05-24 00:44:44 +0900
committerSeo Sanghyeon <sanxiyn@gmail.com>2016-05-24 00:44:44 +0900
commitf27fbf9a4a9b0191338b59d34dda0ddcfe833754 (patch)
tree39081ca403773b7c173208e99c8f8ef9bcd0985e /src/libsyntax
parente24d621fcacf59fa8ecc1c1af1c4adeded4bddee (diff)
downloadrust-f27fbf9a4a9b0191338b59d34dda0ddcfe833754.tar.gz
rust-f27fbf9a4a9b0191338b59d34dda0ddcfe833754.zip
Do not inject test harness for --cfg test
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/test.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index 8eeb61e0de4..56485433101 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -68,14 +68,10 @@ struct TestCtxt<'a> {
 // Traverse the crate, collecting all the test functions, eliding any
 // existing main functions, and synthesizing a main test harness
 pub fn modify_for_testing(sess: &ParseSess,
+                          should_test: bool,
                           cfg: &ast::CrateConfig,
                           krate: ast::Crate,
                           span_diagnostic: &errors::Handler) -> ast::Crate {
-    // We generate the test harness when building in the 'test'
-    // configuration, either with the '--test' or '--cfg test'
-    // command line options.
-    let should_test = attr::contains_name(&krate.config, "test");
-
     // Check for #[reexport_test_harness_main = "some_name"] which
     // creates a `use some_name = __test::main;`. This needs to be
     // unconditional, so that the attribute is still marked as used in