Skip to content

Commit

Permalink
Strengthen testbox_tests output-test
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaslueg committed Apr 11, 2024
1 parent bd869d1 commit 494619b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/testbox_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn main() {
"cargo failed with {}",
String::from_utf8_lossy(&cargo_result.stderr)
);
assert!(String::from_utf8_lossy(&cargo_result.stdout).contains("builttestsuccess"));
}

fn build(root: &std::path::Path, extra_args: &[&str]) {
Expand Down Expand Up @@ -304,6 +305,7 @@ fn main() {
assert_ne!(built_info::CFG_POINTER_WIDTH, "");
// For CFG_ENV, empty string is a possible value.
let _: &'static str = built_info::CFG_ENV;
println!("builttestsuccess");
}"#,
);

Expand Down Expand Up @@ -341,6 +343,7 @@ mod built_info {
}
fn main() {
assert_eq!(built_info::PKG_VERSION, "5.6.7");
println!("builttestsuccess");
}
"#,
);
Expand Down Expand Up @@ -459,6 +462,7 @@ fn main() {
assert_eq!(built_info::DIRECT_DEPENDENCIES[0].0, "built");
assert!((built::chrono::offset::Utc::now() - built::util::strptime(built_info::BUILT_TIME_UTC)).num_days() <= 1);
println!("builttestsuccess");
}"#,
);
p.create_and_run(&[]);
Expand All @@ -478,6 +482,7 @@ mod built_info {
fn main() {
assert_eq!(built_info::GIT_DIRTY, None);
println!("builttestsuccess");
}
"#,
);
Expand All @@ -498,6 +503,7 @@ mod built_info {
fn main() {
assert_eq!(built_info::GIT_DIRTY, Some(false));
println!("builttestsuccess");
}
"#,
);
Expand Down Expand Up @@ -538,6 +544,7 @@ fn main() {
assert!(built_info::GIT_COMMIT_HASH.is_some());
assert!(built_info::GIT_COMMIT_HASH_SHORT.is_some());
assert!(built_info::GIT_COMMIT_HASH.unwrap().starts_with(built_info::GIT_COMMIT_HASH_SHORT.unwrap()));
println!("builttestsuccess");
}
"#
.as_bytes(),
Expand All @@ -559,7 +566,9 @@ mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}
fn main() {}
fn main() {
println!("builttestsuccess");
}
"#,
);
p.init_git();
Expand All @@ -580,7 +589,9 @@ mod built_info {
include!(concat!(env!("OUT_DIR"), "/built.rs"));
}
fn main() {}
fn main() {
println!("builttestsuccess");
}
"#,
);

Expand Down

0 comments on commit 494619b

Please sign in to comment.