Skip to content

Commit

Permalink
Merge pull request #3740 from epage/ui
Browse files Browse the repository at this point in the history
test: Re-enable ui tests
  • Loading branch information
epage committed May 20, 2022
2 parents d1d67fd + e0e7383 commit b202eed
Show file tree
Hide file tree
Showing 7 changed files with 89 additions and 57 deletions.
2 changes: 1 addition & 1 deletion tests/derive_ui.rs
Expand Up @@ -6,7 +6,7 @@
// option. This file may not be copied, modified, or distributed

#[cfg(feature = "derive")]
#[rustversion::attr(any(not(stable), before(1.54), since(1.55)), ignore)]
#[rustversion::attr(any(not(stable), before(1.56), since(1.57)), ignore)] // MSRV
#[test]
fn ui() {
let t = trybuild::TestCases::new();
Expand Down
32 changes: 20 additions & 12 deletions tests/derive_ui/enum_variant_not_args.stderr
@@ -1,15 +1,23 @@
error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args`
--> tests/derive_ui/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
note: required by `augment_args`
--> src/derive.rs
|
| fn augment_args(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args_for_update`
--> tests/derive_ui/enum_variant_not_args.rs:3:9
|
3 | Sub(SubCmd),
| ^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
note: required by `augment_args_for_update`
--> src/derive.rs
|
| fn augment_args_for_update(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 changes: 20 additions & 12 deletions tests/derive_ui/flatten_enum_in_struct.stderr
@@ -1,15 +1,23 @@
error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/flatten_enum_in_struct.rs:3:12
|
3 | #[clap(flatten)]
| ^^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args`
--> tests/derive_ui/flatten_enum_in_struct.rs:3:12
|
3 | #[clap(flatten)]
| ^^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
note: required by `augment_args`
--> src/derive.rs
|
| fn augment_args(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `SubCmd: clap::Args` is not satisfied
--> $DIR/flatten_enum_in_struct.rs:3:12
|
3 | #[clap(flatten)]
| ^^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
= note: required by `augment_args_for_update`
--> tests/derive_ui/flatten_enum_in_struct.rs:3:12
|
3 | #[clap(flatten)]
| ^^^^^^^ the trait `clap::Args` is not implemented for `SubCmd`
|
note: required by `augment_args_for_update`
--> src/derive.rs
|
| fn augment_args_for_update(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
54 changes: 33 additions & 21 deletions tests/derive_ui/flatten_struct_in_enum.stderr
@@ -1,26 +1,38 @@
error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied
--> $DIR/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
= note: required by `has_subcommand`
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
--> tests/derive_ui/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
note: required by `has_subcommand`
--> src/derive.rs
|
| fn has_subcommand(name: &str) -> bool;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied
--> $DIR/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
= note: required by `augment_subcommands`
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
--> tests/derive_ui/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
note: required by `augment_subcommands`
--> src/derive.rs
|
| fn augment_subcommands(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `SubCmd: Subcommand` is not satisfied
--> $DIR/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
= note: required by `augment_subcommands_for_update`
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
--> tests/derive_ui/flatten_struct_in_enum.rs:1:10
|
1 | #[derive(clap::Parser)]
| ^^^^^^^^^^^^ the trait `Subcommand` is not implemented for `SubCmd`
|
note: required by `augment_subcommands_for_update`
--> src/derive.rs
|
| fn augment_subcommands_for_update(cmd: Command<'_>) -> Command<'_>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: this error originates in the derive macro `clap::Parser` (in Nightly builds, run with -Z macro-backtrace for more info)
6 changes: 4 additions & 2 deletions tests/derive_ui/next/tuple_struct.stderr
Expand Up @@ -16,5 +16,7 @@ error[E0599]: no function or associated item named `parse` found for struct `Opt
| ^^^^^ function or associated item not found in `Opt`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `parse`, perhaps you need to implement it:
candidate #1: `Parser`
= note: the following traits define an item `parse`, perhaps you need to implement one of them:
candidate #1: `StructOpt`
candidate #2: `AnyValueParser`
candidate #3: `TypedValueParser`
12 changes: 6 additions & 6 deletions tests/derive_ui/skip_without_default.stderr
@@ -1,7 +1,7 @@
error[E0277]: the trait bound `Kind: Default` is not satisfied
--> $DIR/skip_without_default.rs:22:12
|
22 | #[clap(skip)]
| ^^^^ the trait `Default` is not implemented for `Kind`
|
= note: required by `std::default::Default::default`
--> tests/derive_ui/skip_without_default.rs:22:12
|
22 | #[clap(skip)]
| ^^^^ the trait `Default` is not implemented for `Kind`
|
note: required by `std::default::Default::default`
8 changes: 5 additions & 3 deletions tests/derive_ui/stable/tuple_struct.stderr
@@ -1,13 +1,13 @@
error: `#[derive(Parser)]` only supports non-tuple structs and enums
--> $DIR/tuple_struct.rs:11:10
--> tests/derive_ui/stable/tuple_struct.rs:11:10
|
11 | #[derive(Parser, Debug)]
| ^^^^^^
|
= note: this error originates in the derive macro `Parser` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0599]: no function or associated item named `parse` found for struct `Opt` in the current scope
--> $DIR/tuple_struct.rs:16:20
--> tests/derive_ui/stable/tuple_struct.rs:16:20
|
13 | struct Opt(u32);
| ---------------- function or associated item `parse` not found for this
Expand All @@ -16,5 +16,7 @@ error[E0599]: no function or associated item named `parse` found for struct `Opt
| ^^^^^ function or associated item not found in `Opt`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `parse`, perhaps you need to implement it:
= note: the following traits define an item `parse`, perhaps you need to implement one of them:
candidate #1: `Parser`
candidate #2: `AnyValueParser`
candidate #3: `TypedValueParser`

0 comments on commit b202eed

Please sign in to comment.