| 1 | use stdrust-analyzer cargo std https://github.com/rust-lang/rust/library/std crate/::pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/::Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#; |
| 2 | |
| 3 | #[testrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/test:] |
| 4 | #[ignore] |
| 5 | fn ui_testsrust-analyzer cargo sqlx 0.8.3 ui_tests().() { |
| 6 | let t = trybuildrust-analyzer cargo trybuild 1.0.120 crate/::TestCasesrust-analyzer cargo trybuild 1.0.120 TestCases#::newrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]new().(); |
| 7 | |
| 8 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(feature = "postgres") { |
| 9 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/postgres/*.rs"); |
| 10 | |
| 11 | // UI tests for column types that require gated features |
| 12 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "chrono")) && cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "time")) { |
| 13 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/postgres/gated/chrono.rs"); |
| 14 | } |
| 15 | |
| 16 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "uuid")) { |
| 17 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/postgres/gated/uuid.rs"); |
| 18 | } |
| 19 | |
| 20 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "ipnetwork")) { |
| 21 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/postgres/gated/ipnetwork.rs"); |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(feature = "mysql") { |
| 26 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/mysql/*.rs"); |
| 27 | |
| 28 | // UI tests for column types that require gated features |
| 29 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "chrono")) && cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(not(feature = "time")) { |
| 30 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/mysql/gated/chrono.rs"); |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | if cfgrust-analyzer cargo core https://github.com/rust-lang/rust/library/core macros/builtin/cfg!!(feature = "_sqlite") { |
| 35 | if dotenvyrust-analyzer cargo dotenvy 0.15.7 crate/::varrust-analyzer cargo dotenvy 0.15.7 var().("DATABASE_URL").map_orrust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]map_or().(true, |v| { |
| 36 | Pathrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/Path#::is_relativerust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[Path]is_relative().(v.trim_start_matchesrust-analyzer cargo core https://github.com/rust-lang/rust/library/core str/impl#[str]trim_start_matches().("sqlite://").as_refrust-analyzer cargo std https://github.com/rust-lang/rust/library/std path/impl#[str][`AsRef<Path>`]as_ref().()) |
| 37 | }) { |
| 38 | // this isn't `Trybuild`'s fault: https://github.com/dtolnay/trybuild/issues/69#issuecomment-620329526 |
| 39 | panicrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/panic!!("DATABASE_URL must contain an absolute path for SQLite UI tests") |
| 40 | } |
| 41 | |
| 42 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/sqlite/*.rs"); |
| 43 | } |
| 44 | |
| 45 | t.compile_failrust-analyzer cargo trybuild 1.0.120 impl#[TestCases]compile_fail().("tests/ui/*.rs"); |
| 46 | } |