about summary refs log tree commit diff
path: root/src/test/rustfix/issue-45562.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-05-02 08:43:15 -0700
committerAlex Crichton <alex@alexcrichton.com>2018-05-04 15:01:28 -0700
commitfa9e55faeb0b4fac282ed47f20780c05f4efc86d (patch)
tree0dd43731c9c58b5a41d1cc4be32821d873b71801 /src/test/rustfix/issue-45562.rs
parentb2645044039cb59858ec494e0ddacbe597757cdb (diff)
downloadrust-fa9e55faeb0b4fac282ed47f20780c05f4efc86d.tar.gz
rust-fa9e55faeb0b4fac282ed47f20780c05f4efc86d.zip
test: Make a dedicated testsuite for rustfix
This commit adds a dedicated mode to compiletest for running rustfix tests,
adding a new `src/test/rustfix` directory which will execute all tests as a
"rustfix" test, namely requiring that a `*.fixed` is next to the main file which
is the result of the rustfix project's application of fixes.

The `rustfix` crate is pulled in to actually perform the fixing, and the rustfix
compiletest mode will assert a few properties about the fixing:

* The expected fixed output must be the same as rustc's output suggestions
  applied to the original code.
* The fixed code must compile successfully
* The fixed code must have no further diagnostics emitted about it
Diffstat (limited to 'src/test/rustfix/issue-45562.rs')
-rw-r--r--src/test/rustfix/issue-45562.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/rustfix/issue-45562.rs b/src/test/rustfix/issue-45562.rs
new file mode 100644
index 00000000000..39576e9c845
--- /dev/null
+++ b/src/test/rustfix/issue-45562.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// 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.
+
+#[no_mangle] pub const RAH: usize = 5;
+
+fn main() {}