5 releases

Uses old Rust 2015

0.2.0 May 21, 2018
0.1.3 May 15, 2018
0.1.2 May 13, 2018
0.1.1 May 9, 2018
0.1.0 May 7, 2018

#113 in #compilation

22 downloads per month
Used in ptx-linker

MIT license

30KB
756 lines

Rust Crate Compilation Test helper

Swiss army knife for proc-macro crates testing.

Build Status Current Version

Purpose

The library was highly inspired by laumann/compiletest-rs, and it's origin Rust's compiletest. Difference between them and this library is that latter lets to test whole crates instead of single compilation units.

This can be useful if your proc-macro uses cargo (or xargo) or you want to test more complex scenarios.

There is a lot of work needs to be done, to get feature parity with the other Rust compilation testing libs, currently planned only:

  • Successful Compilation tests
  • Failed Compilation tests
  • Macro Expansion tests

Installation

No third party tools are needed. Just add the library to dev-dependencies:

[dev-dependencies]
crate-compile-test = "0.1"

Usage

The example usage can be found at example directory.

Failed Compilation messages

Expected messages specification is similar to original compiletest's specification, with small addition - you can specify either error code or error message:

use mod2::func3; //~ ERROR unresolved import `mod2::func3`

fn func2() -> NonExistingType {
    0
}
//~^^^ ERROR E0433

Macro Expansion

TBD

Dependencies

~5–15MB
~208K SLoC