Skip to content

Commit

Permalink
Depend on trybuild from crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed May 6, 2019
1 parent 1ea2bbf commit c0654b3
Show file tree
Hide file tree
Showing 28 changed files with 17 additions and 899 deletions.
2 changes: 1 addition & 1 deletion .template/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
# TODO
2 changes: 1 addition & 1 deletion .template/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();

// TODO: add tests
//
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,10 @@ detect a problem at compile time; Cargo isn't able to say that failing to
compile is considered a success, and isn't able to compare that the error
message produced by the compiler is exactly what we expect.

The project skeletons in this repository use a custom test harness written
specifically for my procedural macros workshop at the 2019 Rust Latam
conference, though potentially useful elsewhere with a bit of work.
The project skeletons in this repository use an alternative test harness called
[trybuild].

[trybuild]: https://github.com/dtolnay/trybuild

<p align="center">
<a href="#test-harness">
Expand All @@ -346,8 +347,7 @@ conference, though potentially useful elsewhere with a bit of work.

The test harness is geared toward iterating on the implementation of a
procedural macro, observing the errors emitted by failed executions of the
macro, and testing that those errors are as expected. The source of the test
harness can be found under the <kbd>test-runner</kbd> directory.
macro, and testing that those errors are as expected.

<br>

Expand Down
2 changes: 1 addition & 1 deletion bitfield/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
bitfield-impl = { path = "impl" }
2 changes: 1 addition & 1 deletion bitfield/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();
//t.pass("tests/01-specifier-types.rs");
//t.pass("tests/02-storage.rs");
}
2 changes: 1 addition & 1 deletion builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
# TODO
2 changes: 1 addition & 1 deletion builder/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();
//t.pass("tests/01-parse.rs");
//t.pass("tests/02-create-builder.rs");
//t.pass("tests/03-call-setters.rs");
Expand Down
2 changes: 1 addition & 1 deletion debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
# TODO
2 changes: 1 addition & 1 deletion debug/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();
//t.pass("tests/01-parse.rs");
//t.pass("tests/02-impl-debug.rs");
//t.pass("tests/03-custom-format.rs");
Expand Down
2 changes: 1 addition & 1 deletion seq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
# TODO
2 changes: 1 addition & 1 deletion seq/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();
//t.pass("tests/01-parse-header.rs");
//t.pass("tests/02-parse-body.rs");
//t.compile_fail("tests/03-expand-four-errors.rs");
Expand Down
2 changes: 1 addition & 1 deletion sorted/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name = "tests"
path = "tests/progress.rs"

[dev-dependencies]
workshop-test-runner = { path = "../test-runner" }
trybuild = "1.0"

[dependencies]
# TODO
2 changes: 1 addition & 1 deletion sorted/tests/progress.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[test]
fn tests() {
let t = workshop::TestCases::new();
let t = trybuild::TestCases::new();
//t.pass("tests/01-parse-enum.rs");
//t.compile_fail("tests/02-not-enum.rs");
//t.compile_fail("tests/03-out-of-order.rs");
Expand Down
18 changes: 0 additions & 18 deletions test-runner/Cargo.toml

This file was deleted.

Binary file removed test-runner/screenshots/error.png
Binary file not shown.
Binary file removed test-runner/screenshots/mismatch.png
Binary file not shown.
Binary file removed test-runner/screenshots/passing.png
Binary file not shown.
Binary file removed test-runner/screenshots/wip.png
Binary file not shown.
38 changes: 0 additions & 38 deletions test-runner/src/banner.rs

This file was deleted.

80 changes: 0 additions & 80 deletions test-runner/src/cargo.rs

This file was deleted.

72 changes: 0 additions & 72 deletions test-runner/src/error.rs

This file was deleted.

Loading

0 comments on commit c0654b3

Please sign in to comment.