-
-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add snapshot testing with `insta` * temporary dead code allows * explicitly disable backtraces * use `insta_cmd` for command snapshots * move snapshot tests to lib tests * add snapshot bin test harness * Revert "move snapshot tests to lib tests" This reverts commit 72f99bc. * Add test for no lib targets in the workspace * move snapshot outputs to lib tests * move snapshots directory to lib tests * Revert "move snapshots directory to lib tests" This reverts commit b56a113. * Revert "move snapshot outputs to lib tests" This reverts commit 8b6494c. * add test files * Add snapshot testing with `insta` * temporary dead code allows * explicitly disable backtraces * use `insta_cmd` for command snapshots * move snapshot tests to lib tests * add snapshot bin test harness * fix docs * clippy fixes * fix merge ;( * ... * remove old test file * unformat Cargo.toml * clean up
- Loading branch information
1 parent
329c42f
commit 0ed4827
Showing
9 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
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,3 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["bin_only"] |
6 changes: 6 additions & 0 deletions
6
test_crates/manifest_tests/no_lib_targets/new/bin_only/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,6 @@ | ||
[package] | ||
name = "bin_only" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
test_crates/manifest_tests/no_lib_targets/new/bin_only/src/main.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 @@ | ||
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,3 @@ | ||
[workspace] | ||
resolver = "2" | ||
members = ["bin_only"] |
6 changes: 6 additions & 0 deletions
6
test_crates/manifest_tests/no_lib_targets/old/bin_only/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,6 @@ | ||
[package] | ||
name = "bin_only" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] |
1 change: 1 addition & 0 deletions
1
test_crates/manifest_tests/no_lib_targets/old/bin_only/src/main.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 @@ | ||
fn main() {} |
30 changes: 30 additions & 0 deletions
30
...s/snapshot_tests/cargo_semver_checks__snapshot_tests__workspace_no_lib_targets-input.snap
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,30 @@ | ||
--- | ||
source: src/snapshot_tests.rs | ||
expression: check | ||
--- | ||
Check( | ||
scope: Scope( | ||
mode: DenyList(PackageSelection( | ||
selection: Workspace, | ||
excluded_packages: [], | ||
)), | ||
), | ||
current: Rustdoc( | ||
source: Root("test_crates/manifest_tests/no_lib_targets/new"), | ||
), | ||
baseline: Rustdoc( | ||
source: Root("test_crates/manifest_tests/no_lib_targets/old"), | ||
), | ||
release_type: None, | ||
current_feature_config: FeatureConfig( | ||
features_group: Heuristic, | ||
extra_features: [], | ||
is_baseline: false, | ||
), | ||
baseline_feature_config: FeatureConfig( | ||
features_group: Heuristic, | ||
extra_features: [], | ||
is_baseline: true, | ||
), | ||
build_target: None, | ||
) |
8 changes: 8 additions & 0 deletions
8
.../snapshot_tests/cargo_semver_checks__snapshot_tests__workspace_no_lib_targets-output.snap
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,8 @@ | ||
--- | ||
source: src/snapshot_tests.rs | ||
expression: result | ||
--- | ||
--- error --- | ||
no crates with library targets selected, nothing to semver-check | ||
note: only library targets contain an API surface that can be checked for semver | ||
note: skipped the following crates since they have no library target: bin_only |