-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
158 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,10 @@ fn test_build(mut command: Command, expected_dir: &Path) { | |
let stderr = std::str::from_utf8(&output.stderr).unwrap(); | ||
assert!(stderr.lines().any(|line| line.starts_with(&format!( | ||
"warning: [email protected]: {}/", | ||
expected_dir.display() | ||
trim_trailing_slashes(&expected_dir.to_string_lossy()) | ||
)))); | ||
} | ||
|
||
fn trim_trailing_slashes(s: &str) -> &str { | ||
s.trim_end_matches('/') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
use std::process::{exit, Command, ExitStatus, Stdio}; | ||
|
||
fn main() { | ||
let status: ExitStatus = Command::new("echo").stdout(Stdio::null()).status().unwrap(); | ||
let code = status.code().unwrap(); | ||
exit(code); | ||
} |
Empty file.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
message: "Operation not permitted" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ping: sendto: Operation not permitted |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libc::ioctl: Operation not permitted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,32 @@ | ||
use std::path::Path; | ||
use std::{path::Path, process::Command}; | ||
|
||
pub mod util; | ||
|
||
#[test] | ||
fn custom_build_name() { | ||
let dir = Path::new("fixtures/custom_build_name"); | ||
|
||
let status = Command::new("cargo") | ||
.arg("clean") | ||
.current_dir(dir) | ||
.status() | ||
.unwrap(); | ||
assert!(status.success()); | ||
|
||
let mut command = util::build_with_build_wrap(); | ||
command.current_dir(dir); | ||
|
||
let output = util::exec(command, false).unwrap(); | ||
assert!(!output.status.success()); | ||
|
||
let stderr = std::str::from_utf8(&output.stderr).unwrap(); | ||
let syscall = if cfg!(target_os = "linux") { | ||
"socket" | ||
} else { | ||
"sendto" | ||
}; | ||
assert!( | ||
stderr.contains("ping: socket: Operation not permitted"), | ||
stderr.contains(&format!("ping: {syscall}: Operation not permitted")), | ||
"stderr does not contain expected string:\n```\n{stderr}\n```", | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters