-
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.
Add
BUILD_WRAP_ALLOW
environment variable
- Loading branch information
Showing
3 changed files
with
42 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
pub mod util; | ||
|
||
#[test] | ||
fn allow() { | ||
let temp_package = util::temp_package("tests/cases/ping.rs").unwrap(); | ||
|
||
for allow in [false, true] { | ||
let mut command = util::build_with_build_wrap(); | ||
if allow { | ||
command.env("BUILD_WRAP_ALLOW", "1"); | ||
} | ||
command.current_dir(&temp_package); | ||
|
||
let output = util::exec_forwarding_output(command, false).unwrap(); | ||
// smoelius: The command should succeed precisely when `BUILD_SCRIPT_ALLOW` is enabled. | ||
assert_eq!(allow, output.status.success()); | ||
let stderr = std::str::from_utf8(&output.stderr).unwrap(); | ||
assert!(stderr.contains("command failed")); | ||
} | ||
} |