]>
git.proxmox.com Git - rustc.git/blob - vendor/env_logger-0.8.4/tests/log-in-log.rs
3 extern crate env_logger
;
12 impl fmt
::Display
for Foo
{
13 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
21 if env
::var("YOU_ARE_TESTING_NOW").is_ok() {
22 return info
!("{}", Foo
);
25 let exe
= env
::current_exe().unwrap();
26 let out
= process
::Command
::new(exe
)
27 .env("YOU_ARE_TESTING_NOW", "1")
28 .env("RUST_LOG", "debug")
30 .unwrap_or_else(|e
| panic
!("Unable to start child process: {}", e
));
31 if out
.status
.success() {
35 println
!("test failed: {}", out
.status
);
36 println
!("--- stdout\n{}", str::from_utf8(&out
.stdout
).unwrap());
37 println
!("--- stderr\n{}", str::from_utf8(&out
.stderr
).unwrap());