2020-08-23 16:49:05 +00:00
|
|
|
#[test]
|
2022-09-19 16:54:06 +00:00
|
|
|
#[cfg(feature = "help")]
|
2022-09-19 14:59:04 +00:00
|
|
|
#[cfg(feature = "error-context")]
|
2022-09-19 15:43:39 +00:00
|
|
|
#[cfg(feature = "usage")]
|
2021-11-10 22:15:30 +00:00
|
|
|
fn example_tests() {
|
|
|
|
let t = trycmd::TestCases::new();
|
2021-11-23 21:59:56 +00:00
|
|
|
let features = [
|
2023-07-17 21:57:22 +00:00
|
|
|
// Default
|
2021-11-23 21:59:56 +00:00
|
|
|
#[cfg(feature = "std")]
|
|
|
|
"std",
|
2023-07-17 21:57:22 +00:00
|
|
|
#[cfg(feature = "color")]
|
|
|
|
"color",
|
2023-07-17 22:01:31 +00:00
|
|
|
#[cfg(feature = "help")]
|
|
|
|
"help",
|
|
|
|
#[cfg(feature = "usage")]
|
|
|
|
"usage",
|
|
|
|
#[cfg(feature = "error-context")]
|
|
|
|
"error-context",
|
2023-07-17 21:57:22 +00:00
|
|
|
#[cfg(feature = "suggestions")]
|
|
|
|
"suggestions",
|
|
|
|
// Optional
|
2021-11-23 21:59:56 +00:00
|
|
|
#[cfg(feature = "derive")]
|
|
|
|
"derive",
|
|
|
|
#[cfg(feature = "cargo")]
|
|
|
|
"cargo",
|
2023-07-17 21:57:22 +00:00
|
|
|
#[cfg(feature = "wrap_help")]
|
|
|
|
"wrap_help",
|
2021-11-23 21:59:56 +00:00
|
|
|
#[cfg(feature = "env")]
|
|
|
|
"env",
|
|
|
|
#[cfg(feature = "unicode")]
|
|
|
|
"unicode",
|
2022-09-16 16:52:55 +00:00
|
|
|
#[cfg(feature = "string")]
|
|
|
|
"string",
|
2023-07-17 21:57:22 +00:00
|
|
|
// In-work
|
2023-07-17 22:01:31 +00:00
|
|
|
//#[cfg(feature = "unstable-v5")] // Currently has failures
|
|
|
|
//"unstable-v5",
|
2021-11-23 21:59:56 +00:00
|
|
|
]
|
|
|
|
.join(" ");
|
|
|
|
t.register_bins(trycmd::cargo::compile_examples(["--features", &features]).unwrap());
|
2021-11-30 18:30:19 +00:00
|
|
|
t.case("examples/**/*.md");
|
2020-08-23 16:49:05 +00:00
|
|
|
}
|