29 Commits

Author SHA1 Message Date
Dale Wijnand
d5fc8dc3a7
Introduce the CWD macro in test output asserting
Avoids dealing with things like CWD changing.
2018-08-30 11:05:29 +02:00
Dale Wijnand
570fe8927d
Remove hamcrest existing_file() 2018-08-29 10:26:12 +02:00
Dale Wijnand
63b34b6498
Revert back to some .exec_with_output() usage
Avoids difference in indentations across different PATHs.
2018-08-29 02:04:32 +02:00
Dale Wijnand
a173fc0abe
Replace .exec_with_output() usage with .with_stdout_contains 2018-08-29 00:45:19 +02:00
Dale Wijnand
85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Dale Wijnand
16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44:42 +01:00
Dale Wijnand
8940d30668
Make cargo_process take a string it splits on whitespace 2018-08-02 18:00:02 +01:00
Dale Wijnand
09cd53832c
Adapt --list output in find_closest_biuld_to_build test 2018-07-26 21:41:43 +01:00
Dale Wijnand
a838f8fa9c
Fix read-manifest summary printing under cargo --list 2018-07-26 12:09:04 +01:00
Dale Wijnand
af2c355585
Show the command summary when running cargo --list 2018-07-26 12:08:39 +01:00
Dale Wijnand
ab19c48358
Dedup a bunch more manifest 2018-07-25 00:43:30 +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
Dale Wijnand
f8c9928cc1
Rework some test projects to use the "foo" default
Generally that means either switching "foo" and "bar" around (reversing
the arrow), or it means push "foo" to "bar" (and sometimes "bar" to
"baz", etc..) to free up "foo".

For trivia that leaves 80/1222 outliers, therefore 93.4% of test
project use the default. :)
2018-07-21 19:40:45 +01: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
Andy Russell
9e41e383ac
help: display external subcommand help 2018-07-13 15:09:00 -04:00
Klaus Purer
9af095adab tests(help): Fix assertion by using the full line text 2018-03-31 11:33:14 +02:00
Klaus Purer
a4104914ea tests(help): Add test for -Z help output 2018-03-31 11:19:28 +02:00
Aleksey Kladov
deb1c1e15c Fix regression when passing arguments to subcommands 2018-03-20 03:34:37 +03:00
Aleksey Kladov
a1735c7aff Regression tests for #5201
Better safe than sorry!
2018-03-19 23:51:49 +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
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
cc3ce0007d Fix --explain 2018-03-08 23:31:56 +03:00
Aleksey Kladov
0470d77575 Support list subcommand
All tests are green 🎉
2018-03-08 23:31:56 +03:00
Aleksey Kladov
af88c9f203 Disable cargo help -h 2018-03-08 23:31:56 +03:00
Aleksey Kladov
81ce3e1bef Support external subcommands 2018-03-08 23:31:56 +03:00
Aleksey Kladov
c327245ca5 Drop old commands 2018-03-08 23:31:56 +03:00
Aleksey Kladov
178b16d12b Temporarly ignore some tests 2018-03-08 23:30:46 +03:00
André Rocha
98f17bcc56 Adding cargo.rs file tests as cargo_command.rs. 2018-02-21 13:33:52 -05:00