This repository has been archived by the owner on Sep 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cargo-compare] add some comparison testing to CI
This works by: * setting up a real, fairly complex fixture * generating random queries using proptest * running them through cargo and guppy * ensuring that they produce the same results Not only does this give us high confidence that cargo and guppy produce the same results, it also gets us most of the way to #83. Most of the work in this commit is simply setting up all the necessary test infrastructure. We piggy-back on existing proptest infrastructure as much as possible.
- Loading branch information
1 parent
7350da6
commit a8cbe50
Showing
39 changed files
with
593 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "external" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
[dependencies] | ||
transitive = { path = "../transitive" } | ||
bytes = { version = "0.5", optional = true } | ||
|
||
[dev-dependencies] | ||
transitive = { path = "../transitive", features = ["dev-feature"] } | ||
|
||
[build-dependencies] | ||
transitive = { path = "../transitive", features = ["build-feature"] } | ||
|
||
[features] | ||
internal-dev-feature = [] | ||
internal-build-feature = [] | ||
main-dev-feature = [] | ||
main-build-feature = [] | ||
macro-normal-feature = [] | ||
macro-build-feature = [] | ||
macro-dev-feature = [] | ||
side-feature = ["bytes"] | ||
|
||
[workspace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "inactive" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
transitive = { path = "../transitive", features = ["inactive-normal"] } | ||
|
||
[build-dependencies] | ||
transitive = { path = "../transitive", features = ["inactive-build"] } | ||
|
||
[dev-dependencies] | ||
transitive = { path = "../transitive", features = ["inactive-dev"] } | ||
|
||
[features] | ||
extra = ["transitive/extra"] | ||
|
||
[workspace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/target | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "transitive" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[features] | ||
build-feature = [] | ||
dev-feature = [] | ||
inactive-normal = [] | ||
inactive-build = [] | ||
inactive-dev = [] | ||
extra = [] | ||
|
||
[workspace] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[workspace] | ||
members = ["main", "internal", "internal-macro", "side"] |
21 changes: 21 additions & 0 deletions
21
fixtures/workspace/inside-outside/workspace/internal-macro/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[package] | ||
name = "internal-macro" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
||
[dependencies] | ||
external = { path = "../../external", features = ["macro-normal-feature"] } | ||
|
||
[build-dependencies] | ||
external = { path = "../../external", features = ["macro-build-feature"] } | ||
|
||
[dev-dependencies] | ||
external = { path = "../../external", features = ["macro-dev-feature"] } | ||
|
||
[features] | ||
main-build-feature = [] | ||
internal-normal-feature = [] |
Empty file.
7 changes: 7 additions & 0 deletions
7
fixtures/workspace/inside-outside/workspace/internal-macro/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
fixtures/workspace/inside-outside/workspace/internal/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "internal" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
lazy_static = "1" | ||
external = { path = "../../external" } | ||
internal-macro = { path = "../internal-macro", features = ["internal-normal-feature"] } | ||
|
||
[dev-dependencies] | ||
lazy_static = {version = "1", features = ["spin"] } | ||
bytes = "0.5" | ||
external = { path = "../../external", features = ["internal-dev-feature"] } | ||
|
||
[build-dependencies] | ||
external = { path = "../../external", features = ["internal-build-feature"] } | ||
|
||
[features] | ||
dev-feature = [] | ||
build-feature = [] |
7 changes: 7 additions & 0 deletions
7
fixtures/workspace/inside-outside/workspace/internal/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
fixtures/workspace/inside-outside/workspace/main/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
[package] | ||
name = "main" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
build = "build.rs" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
external = { path = "../../external" } | ||
internal = { path = "../internal" } | ||
|
||
[build-dependencies] | ||
external = { path = "../../external", features = ["main-build-feature"] } | ||
internal = { path = "../internal", features = ["build-feature"] } | ||
internal-macro = { path = "../internal-macro", features = ["main-build-feature"] } | ||
|
||
[dev-dependencies] | ||
external = { path = "../../external", features = ["main-dev-feature"] } | ||
internal = { path = "../internal", features = ["dev-feature"] } | ||
|
||
[target.'cfg(all(unix, not(unix)))'.build-dependencies] | ||
inactive = { path = "../../inactive" } | ||
|
||
[features] | ||
inactive-extra = ["inactive/extra"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
fixtures/workspace/inside-outside/workspace/side/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "side" | ||
version = "0.1.0" | ||
authors = ["Fake Author <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
external = { path = "../../external", features = ["side-feature"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
#[test] | ||
fn it_works() { | ||
assert_eq!(2 + 2, 4); | ||
} | ||
} |
Oops, something went wrong.