Diagnose when test features are missing
diff --git a/tests/features/error.rs b/tests/features/error.rs
new file mode 100644
index 0000000..10ac889
--- /dev/null
+++ b/tests/features/error.rs
@@ -0,0 +1 @@
+"Hello! You want: cargo test --release --all-features"
diff --git a/tests/features/mod.rs b/tests/features/mod.rs
new file mode 100644
index 0000000..5df4889
--- /dev/null
+++ b/tests/features/mod.rs
@@ -0,0 +1,13 @@
+#[cfg(not(all(
+ feature = "derive",
+ feature = "full",
+ feature = "parsing",
+ feature = "printing",
+ feature = "visit",
+ feature = "visit-mut",
+ feature = "fold",
+ feature = "clone-impls",
+ feature = "extra-traits",
+ feature = "proc-macro",
+)))]
+mod error;
diff --git a/tests/test_asyncness.rs b/tests/test_asyncness.rs
index b73537b..78bee8c 100644
--- a/tests/test_asyncness.rs
+++ b/tests/test_asyncness.rs
@@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(all(feature = "extra-traits", feature = "full"))]
-
extern crate proc_macro2;
extern crate syn;
+mod features;
+
use proc_macro2::Span;
use syn::punctuated::Punctuated;
use syn::{Block, Expr, ExprBlock, ExprClosure, FnDecl, Ident, ItemFn, ReturnType, Visibility};
diff --git a/tests/test_derive_input.rs b/tests/test_derive_input.rs
index db62f2e..634bbc7 100644
--- a/tests/test_derive_input.rs
+++ b/tests/test_derive_input.rs
@@ -6,11 +6,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(feature = "extra-traits")]
-
extern crate proc_macro2;
extern crate syn;
+mod features;
+
use proc_macro2::Delimiter::{Brace, Parenthesis};
use proc_macro2::*;
use syn::punctuated::Punctuated;
diff --git a/tests/test_generics.rs b/tests/test_generics.rs
index 1cf2953..a036a50 100644
--- a/tests/test_generics.rs
+++ b/tests/test_generics.rs
@@ -6,7 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(feature = "extra-traits")]
#![recursion_limit = "1024"]
#![feature(rustc_private)]
@@ -23,6 +22,7 @@
mod macros;
mod common;
+mod features;
fn ident(s: &str) -> Ident {
Ident::new(s, Span::call_site())
diff --git a/tests/test_grouping.rs b/tests/test_grouping.rs
index 2645cff..7d2bcc6 100644
--- a/tests/test_grouping.rs
+++ b/tests/test_grouping.rs
@@ -6,7 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(all(feature = "extra-traits", feature = "full"))]
#![recursion_limit = "1024"]
#![feature(rustc_private)]
@@ -22,6 +21,7 @@
mod macros;
mod common;
+mod features;
fn expr<T: Into<Expr>>(t: T) -> Expr {
t.into()
diff --git a/tests/test_ident.rs b/tests/test_ident.rs
index 498e8be..6134c54 100644
--- a/tests/test_ident.rs
+++ b/tests/test_ident.rs
@@ -9,6 +9,8 @@
extern crate proc_macro2;
extern crate syn;
+mod features;
+
use proc_macro2::{Ident, Span, TokenStream};
use std::str::FromStr;
use syn::parse::Error;
diff --git a/tests/test_lit.rs b/tests/test_lit.rs
index b0e4004..2cdc7dc 100644
--- a/tests/test_lit.rs
+++ b/tests/test_lit.rs
@@ -10,6 +10,8 @@
extern crate quote;
extern crate syn;
+mod features;
+
use proc_macro2::{TokenStream, TokenTree};
use quote::ToTokens;
use std::str::FromStr;
diff --git a/tests/test_meta_item.rs b/tests/test_meta_item.rs
index 1423474..4f6da4e 100644
--- a/tests/test_meta_item.rs
+++ b/tests/test_meta_item.rs
@@ -6,12 +6,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(feature = "extra-traits")]
-
extern crate proc_macro2;
extern crate quote;
extern crate syn;
+mod features;
+
use proc_macro2::{Ident, Literal, Span};
use syn::parse::Parser;
use syn::*;
diff --git a/tests/test_pat.rs b/tests/test_pat.rs
index 7020313..8f04b0d 100644
--- a/tests/test_pat.rs
+++ b/tests/test_pat.rs
@@ -10,6 +10,8 @@
extern crate quote;
extern crate syn;
+mod features;
+
#[test]
fn test_pat_ident() {
match syn::parse2(quote!(self)).unwrap() {
diff --git a/tests/test_precedence.rs b/tests/test_precedence.rs
index 93d50a4..5dbaa2d 100644
--- a/tests/test_precedence.rs
+++ b/tests/test_precedence.rs
@@ -6,7 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(all(feature = "full", feature = "fold"))]
#![recursion_limit = "1024"]
#![feature(rustc_private)]
@@ -33,6 +32,8 @@
extern crate syntax;
extern crate walkdir;
+mod features;
+
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use regex::Regex;
use syntax::ast;
diff --git a/tests/test_round_trip.rs b/tests/test_round_trip.rs
index 954c34d..96a82dc 100644
--- a/tests/test_round_trip.rs
+++ b/tests/test_round_trip.rs
@@ -6,7 +6,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(feature = "full")]
#![recursion_limit = "1024"]
#![feature(rustc_private)]
@@ -18,6 +17,8 @@
extern crate syntax_pos;
extern crate walkdir;
+mod features;
+
use rayon::iter::{IntoParallelIterator, ParallelIterator};
use syntax::ast;
use syntax::parse::{self, PResult, ParseSess};
diff --git a/tests/test_should_parse.rs b/tests/test_should_parse.rs
index 03096e3..a819804 100644
--- a/tests/test_should_parse.rs
+++ b/tests/test_should_parse.rs
@@ -8,6 +8,8 @@
extern crate syn;
+mod features;
+
macro_rules! should_parse {
($name:ident, { $($in:tt)* }) => {
#[test]
diff --git a/tests/test_token_trees.rs b/tests/test_token_trees.rs
index 02d8f48..9f79814 100644
--- a/tests/test_token_trees.rs
+++ b/tests/test_token_trees.rs
@@ -6,13 +6,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-#![cfg(feature = "extra-traits")]
-
extern crate proc_macro2;
#[macro_use]
extern crate quote;
extern crate syn;
+mod features;
+
use proc_macro2::Delimiter::*;
use proc_macro2::*;
use syn::{AttrStyle, Attribute, Lit};