serde/test_suite/tests/compiletest.rs
David Tolnay e26960f7f8
Remove useless run-pass test
When originally added, this test used to contain a `#![plugin(clippy)]`.
This was removed at some point along the way, at which point this test
no longer tests anything. It prints:

    warning: unknown lint: `identity_op`
     --> src/main.rs:1:9
      |
    1 | #![deny(identity_op)]
      |         ^^^^^^^^^^^
      |
      = note: #[warn(unknown_lints)] on by default

which is swallowed and ignored by compiletest.

Nowadays Clippy handles warnings inside of macro expanded code
intelligently and this is something they would be responsible for
testing.
2018-08-06 22:57:46 -07:00

32 lines
894 B
Rust

// Copyright 2017 Serde Developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![cfg(feature = "unstable")]
extern crate compiletest_rs as compiletest;
use std::env;
fn run_mode(mode: &'static str) {
let mut config = compiletest::Config::default();
config.mode = mode.parse().expect("invalid mode");
config.target_rustcflags = Some("-L deps/target/debug/deps".to_owned());
if let Ok(name) = env::var("TESTNAME") {
config.filter = Some(name);
}
config.src_base = format!("tests/{}", mode).into();
compiletest::run_tests(&config);
}
#[test]
fn compile_fail() {
run_mode("compile-fail");
}