mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-05 11:05:46 +00:00
tests: use if cfg!(..) instead of #[cfg(..)] to insert Windows-specific config
The code compiles on all platforms, so I think `if cfg!(..)` is better.
This commit is contained in:
parent
aea135cb8f
commit
d94c325d6c
1 changed files with 2 additions and 4 deletions
|
@ -16,6 +16,7 @@ use std::cell::RefCell;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|
||||||
|
use itertools::Itertools as _;
|
||||||
use regex::{Captures, Regex};
|
use regex::{Captures, Regex};
|
||||||
use tempfile::TempDir;
|
use tempfile::TempDir;
|
||||||
use testutils;
|
use testutils;
|
||||||
|
@ -106,10 +107,7 @@ impl TestEnvironment {
|
||||||
cmd.env("JJ_TIMESTAMP", timestamp.to_rfc3339());
|
cmd.env("JJ_TIMESTAMP", timestamp.to_rfc3339());
|
||||||
cmd.env("JJ_OP_TIMESTAMP", timestamp.to_rfc3339());
|
cmd.env("JJ_OP_TIMESTAMP", timestamp.to_rfc3339());
|
||||||
|
|
||||||
#[cfg(all(windows, target_env = "gnu"))]
|
if cfg!(all(windows, target_env = "gnu")) {
|
||||||
{
|
|
||||||
use itertools::Itertools as _;
|
|
||||||
|
|
||||||
// MinGW executables cannot run without `mingw\bin` in the PATH (which we're
|
// MinGW executables cannot run without `mingw\bin` in the PATH (which we're
|
||||||
// clearing above), so we add it again here.
|
// clearing above), so we add it again here.
|
||||||
if let Ok(path_var) = std::env::var("PATH").or_else(|_| std::env::var("Path")) {
|
if let Ok(path_var) = std::env::var("PATH").or_else(|_| std::env::var("Path")) {
|
||||||
|
|
Loading…
Reference in a new issue