Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upWIP: Holistic CLI test harness experiments #98
Conversation
This comment has been minimized.
This comment has been minimized.
|
btw, |
epage
added some commits
Mar 24, 2018
epage
force-pushed the
epage:trait
branch
from
a211010
to
9767301
Mar 29, 2018
epage
added some commits
Mar 29, 2018
This comment has been minimized.
This comment has been minimized.
|
fyi @nikomatsakis just told me he used assert_cli and manually added a tempdir wrapper because that was missing |
peddermaster2
reviewed
Apr 3, 2018
|
|
||
| impl CommandCargoExt for process::Command { | ||
| fn main_binary() -> Self { | ||
| let mut cmd = process::Command::new("carg"); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
epage
Apr 3, 2018
Author
Collaborator
Thanks!
Obviously very little testing has been done which might be clear considering this is here :). This is a rough sketch to get high level feedback before actually getting the details right.
vincentdephily
referenced this pull request
Apr 5, 2018
Closed
Allow checking for any command exit value. #99
This was referenced Apr 7, 2018
This comment has been minimized.
This comment has been minimized.
|
My current thought on crate organization
Couple questions from that
|
epage
referenced this pull request
May 15, 2018
Closed
Feature Request: `wait` and/or `then` methods after writing to stdin #106
killercup
approved these changes
May 24, 2018
|
Very cool! Sorry it took me so long to around to this, @epage. I've long been in favor of splitting assert_cli up into smaller pieces. What we should also offer in the long run, though, is a way to easily extend this, e.g., to make shortcut methods to set a bunch of env vars. |
| /// ``` | ||
| fn main_binary() -> Self; | ||
|
|
||
| /// Create a `Command` Run a specific binary of the current crate. |
This comment has been minimized.
This comment has been minimized.
| /// `std::process::Output` represented as a `Result`. | ||
| pub type OutputResult = Result<process::Output, OutputError>; | ||
|
|
||
| /// Extends `std::process::Output` with methods to to convert it to an `OutputResult`. |
This comment has been minimized.
This comment has been minimized.
| /// | ||
| /// By default, stdin, stdout and stderr are inherited from the parent. | ||
| /// | ||
| /// *(mirrors `std::process::Command::spawn`** |
This comment has been minimized.
This comment has been minimized.
|
|
||
| /// Extend `TempDir` to run commands in it. | ||
| pub trait TempDirCommandExt { | ||
| /// Constructs a new Command for launching the program at path program, with the following |
This comment has been minimized.
This comment has been minimized.
| /// temp.command("pwd").output().unwrap(); | ||
| /// temp.close().unwrap(); | ||
| /// ``` | ||
| fn command<S>(&self, program: S) -> process::Command |
This comment has been minimized.
This comment has been minimized.
volks73
referenced this pull request
May 24, 2018
Open
Add optional access to Command's stdin handle #107
This comment has been minimized.
This comment has been minimized.
|
This is now implemented as |
epage commentedMar 27, 2018
This includes
cli_test_dir, another holistic harness that is more rigid in its APISee commit messages for more details
Work to do
Asserts ability to run commands with traits