Skip to content

Commit eb5a768

Browse files
tests: show stdout on error
1 parent 854f1d6 commit eb5a768

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/src/lib.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ mod integration {
127127
BUILD.call_once(|| {
128128
assert!(Command::new("cargo")
129129
.arg("build")
130+
.arg("--release")
130131
.output()
131132
.expect("failed to build extension")
132133
.status
@@ -136,15 +137,19 @@ mod integration {
136137

137138
pub fn run_php(file: &str) -> bool {
138139
setup();
139-
Command::new("php")
140+
let output = Command::new("php")
140141
.arg(format!(
141-
"-dextension=../target/debug/libtests.{}",
142+
"-dextension=../target/release/libtests.{}",
142143
std::env::consts::DLL_EXTENSION
143144
))
144145
.arg(format!("src/integration/{}", file))
145-
.status()
146-
.expect("failed to run php file")
147-
.success()
146+
.output()
147+
.expect("failed to run php file");
148+
if output.status.success() {
149+
true
150+
} else {
151+
panic!("{}", String::from_utf8(output.stdout).unwrap());
152+
}
148153
}
149154

150155
mod array;

0 commit comments

Comments
 (0)