134 Commits

Author SHA1 Message Date
Dale Wijnand
05400b8018
Drop the [/] test output macro 2018-08-02 10:18:48 +01:00
Dale Wijnand
ca7d9ee292
Declare one-line files on one line, in test projects 2018-07-25 09:58:50 +01:00
Dale Wijnand
ab19c48358
Dedup a bunch more manifest 2018-07-25 00:43:30 +01:00
Dale Wijnand
081e7930d2
Drop now unnecessary basic manifests 2018-07-24 16:33:55 +01:00
Dale Wijnand
252f6e8e9f
Opt-out all other failing tests
Looks like cargo traverses the filesystem & fails if it runs into a
Cargo.toml that doesn't declare a target.  I couldn't find a nice way to
re-engineer the test to avoid this issue.  So I'll leave that as someone
else's exercise.
2018-07-24 13:59:42 +01:00
Dale Wijnand
43b42d6f4c
Reorganise the testsuite crate module hierarchy
* Collapse the nested cargotest::support module into the cargotest
  module (merge the mod.rs's)
* Rename the cargotest module to support
* Nest the top-level hamcrest module into support
2018-07-22 08:46:44 +01:00
bors
b4a245e6f4 Auto merge of #5751 - RalfJung:default-run, r=alexcrichton
cargo run: on nightly, advertise the default-run feature
2018-07-21 23:03:13 +00:00
Dale Wijnand
7fe2fbc8a3
Remove the argument from the project test support function
By rewriting the tests, with rerast (https://github.com/google/rerast),
to use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
        project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
        replace!(project("foo") => project_foo());
        replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests
2018-07-20 13:31:50 +01:00
Ralf Jung
d1372315b3 cargo run: on nightly, advertise the default-run feature 2018-07-20 12:48:47 +02:00
Ralf Jung
04abd5ef2f fix code nits 2018-07-16 21:48:14 +02:00
Ralf Jung
579e0348d7 order of lits of binaries is not stable 2018-07-16 21:48:14 +02:00
Ralf Jung
c955c60e6b feature-gate default-run 2018-07-16 21:48:14 +02:00
Ralf Jung
5936f6ae9e implement default-run option to set default binary for cargo run 2018-07-16 21:48:14 +02:00
bors
556f80f3dc Auto merge of #5485 - patriksvensson:feature/GH-5474, r=matklad
Do not allow running library examples.

This is my first contribution to anything Rust related that I haven't written myself, and I'm not a very proficient Rust programmer (yet), so would love some feedback on improvements.

I also might have solved this the wrong way... 😄

Closes #5474

(cc @matklad)
2018-05-05 14:24:55 +00:00
Patrik Svensson
8da2908056 Made adjustments based on feedback from review. 2018-05-05 16:20:53 +02:00
Patrik Svensson
5b49778719 Do not allow running library examples.
Closes #5474
2018-05-05 10:51:48 +02:00
Alex Crichton
8413008937 Rename the rust manifest key to edition
This'll hopefully jive better with the terminology of "edition" throughout the
rest of Rust!
2018-05-03 11:45:04 -07:00
Aleksey Kladov
30e52ca906 Extend dashes forwarding test 2018-04-28 17:57:03 +03:00
Dale Wijnand
ab5ac28a42
backtick auto-discovery key usage advice 2018-04-20 22:23:08 +01:00
Dale Wijnand
d3f5fefa5c
manually line wrap warnings at 80 characters 2018-04-20 22:22:41 +01:00
Dale Wijnand
54e7bc51a2
prefer PathBuf::display over {:?} 2018-04-20 22:21:33 +01:00
Dale Wijnand
abbd69e747
avoid windows path assertion bug 2018-04-20 22:20:31 +01:00
Dale Wijnand
e471745e47
Introduce autoXXX keys for target auto-discovery
In Rust 2015 absence of the configuration makes it default to not
include auto-discovered targets (i.e false), with a warnings message.

In Rust 2018 absence makes it default to include auto-discovered
targets (i.e true).

Fixes #5330
2018-04-20 20:57:24 +01:00
Aleksey Kladov
e5971b935c Slightly improve ergonomics of writing Cargo tests 2018-03-17 00:08:23 +03:00
Aleksey Kladov
70ff33a537 Fix a regression with parsing multivalue options
By default, clap interprets

```
cargo run --bin foo bar baz
```

as

```
cargo run --bin foo --bin bar --bin baz
```

This behavior is different from docopt and does not play nicely with
positional arguments at all. Luckily, clap has a flag to get the
behavior we want, it just not the default! It will become the default in
the next version of clap, but, until that time, we should be careful
when using the combination of `.long`, `.value_name` and
`.multiple(true)`, and don't forget to specify `.number_of_values(1)` as
well.
2018-03-16 17:35:13 +03:00
Aleksey Kladov
b0c181d91c Prettify rustfmted single-line strings 2018-03-14 17:48:44 -07:00
Alex Crichton
1e6828485e cargo fmt 2018-03-14 17:48:23 -07:00
Aleksey Kladov
74f4089387 Fix spelling of quiet 2018-03-12 23:08:49 +03:00
Aleksey Kladov
a64df78ea6 Relax tests for windows
On windows, clap prints `cargo.exe` rather than just `cargo`.
2018-03-10 18:46:32 +03:00
Aleksey Kladov
6783272a82 Fix more tests by updating error messages 2018-03-08 23:31:56 +03:00
Aleksey Kladov
4d3ca92150 Use exit code 1 for command line parsing errors
Note that while we use 101 in majority of cases, sometimes we use 1 as
well.
2018-03-08 23:31:56 +03:00
Aleksey Kladov
7bf1619c01 Move run to clap 2018-03-08 23:30:47 +03:00
Aleksey Kladov
96a4aa836e Drop ignored tests 2018-03-06 23:28:52 +03:00
André Rocha
c2ff988c9f Reorganize integration tests as one crate with many modules. Issue #4867. 2018-02-21 13:33:51 -05:00