Debian Codegraph @

debian/rust-vendor/defmt/tests/ui_logs_off.rs

raw
1 #[test]
2 fn ui_logs_off() {
3 // Run UI tests with logging disabled to ensure compiler errors are the same
4 std::env::set_var("DEFMT_LOG", "off");
5
6 // only test error messages on the stable channel (nightly may change too often)
7 if rustc_version::version_meta()
8 .map(|meta| meta.channel == rustc_version::Channel::Stable)
9 .unwrap_or(false)
10 && std::env::var_os("SKIP_UI_TESTS").is_none()
11 {
12 let t = trybuild::TestCases::new();
13 t.compile_fail("tests/ui/*.rs");
14
15 t.pass("tests/basic_usage.rs");
16 t.pass("tests/derive-bounds.rs");
17 }
18 }