Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document that tests require a gnu-like shell #25

Closed
CAD97 opened this issue May 7, 2021 · 1 comment
Closed

Document that tests require a gnu-like shell #25

CAD97 opened this issue May 7, 2021 · 1 comment

Comments

@CAD97
Copy link
Contributor

CAD97 commented May 7, 2021

Specifically, running tests in Powershell, I ran into test failures (in the details below), but everything passed in Git Bash. Specifically, it looks like use of false and echo failed.

Tests don't necessarily need to pass in every shell context out there (though it would be convenient, since xshell is trying to make exactly that more practical); it'd just be nice to document the required environment.

Alternative solutions:

  • Rewrite the failing tests to not use echo/false, just (ab)using cargo, clippy, and/or rustc, which are known to be present instead
  • Provide shims for echo and false for prominent non-gnu-like shells as people request them
Test failures on Powershell
failures:

---- program_interpolation stdout ----
thread 'program_interpolation' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:34:46
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- ignore_status stdout ----
thread 'ignore_status' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `false`', tests\it.rs:82:55

---- interpolation_move stdout ----
thread 'interpolation_move' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:49:47

---- interpolation stdout ----
thread 'interpolation' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:27:46

---- multiline stdout ----
thread 'multiline' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:20:6

---- interpolation_concatenation stdout ----
thread 'interpolation_concatenation' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:42:54

---- exit_status stdout ----
thread 'exit_status' panicked at 'assertion failed: `(left == right)`
  left: `"command not found: `false`"`,
 right: `"command `false` failed, exit code: 1"`', tests\it.rs:77:5

---- interpolation_spat stdout ----
thread 'interpolation_spat' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:59:59

---- escape stdout ----
thread 'escape' panicked at 'called `Result::unwrap()` on an `Err` value: command not found: `echo`', tests\it.rs:107:60

failures:
    escape
    exit_status
    ignore_status
    interpolation
    interpolation_concatenation
    interpolation_move
    interpolation_spat
    multiline
    program_interpolation

test result: FAILED. 17 passed; 9 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.03s
@matklad
Copy link
Owner

matklad commented May 7, 2021

We should fix test to not rely on external stuff. It would actually be useful to have a binary (in examples dir) which echoes its arguments in quotes.

matklad added a commit that referenced this issue May 9, 2021
matklad added a commit that referenced this issue May 9, 2021
matklad added a commit that referenced this issue May 9, 2021
@bors bors bot closed this as completed in d9bc761 May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants