requires_reason = true;
ignore |= is_not_nightly();
}
- "disable_git_cli" => {
- ignore |= disable_git_cli();
- }
s if s.starts_with("requires_") => {
let command = &s[9..];
ignore |= !has_command(command);
unsafe { &VERSION }
}
-fn disable_git_cli() -> bool {
- // mingw git on Windows does not support Windows-style file URIs.
- // Appveyor in the rust repo has that git up front in the PATH instead
- // of Git-for-Windows, which causes this to fail.
- matches!(option_env!("CARGO_TEST_DISABLE_GIT_CLI"), Some("1"))
-}
-
fn has_command(command: &str) -> bool {
let output = match Command::new(command).arg("--version").output() {
Ok(output) => output,
* `>=1.64` — This indicates that the test will only run with the given version of `rustc` or newer.
This can be used when a new `rustc` feature has been stabilized that the test depends on.
If this is specified, a `reason` is required to explain why it is being checked.
-* `disable_git_cli` — This is needed for `git-fetch-with-cli` tests.
- This disables the test in rust-lang/rust's CI due to a compatibility issue.
#### Testing Nightly Features
t.join().unwrap();
}
-#[cargo_test(disable_git_cli)]
+#[cargo_test]
fn use_the_cli() {
let project = project();
let git_project = git::new("dep1", |project| {
p.cargo("build").run();
}
-#[cargo_test(disable_git_cli)]
+#[cargo_test]
fn git_with_cli_force() {
// Supports a force-pushed repo.
let git_project = git::new("dep1", |project| {
p.rename_run("foo", "foo2").with_stdout("two").run();
}
-#[cargo_test(disable_git_cli)]
+#[cargo_test]
fn git_fetch_cli_env_clean() {
// This tests that git-fetch-with-cli works when GIT_DIR environment
// variable is set (for whatever reason).
_corrupted_checkout(false);
}
-#[cargo_test(disable_git_cli)]
+#[cargo_test]
fn corrupted_checkout_with_cli() {
// Test what happens if the checkout is corrupted somehow with git cli.
_corrupted_checkout(true);