()
| 1016 | /// Fails with an error if any file would change, similar to `cargo fmt --check`. |
| 1017 | #[context("Checking TMT generated files")] |
| 1018 | pub(crate) fn check_integration() -> Result<()> { |
| 1019 | let tests_fmf_path = Utf8Path::new("tmt/tests/tests.fmf"); |
| 1020 | let integration_fmf_path = Utf8Path::new("tmt/plans/integration.fmf"); |
| 1021 | |
| 1022 | let (tests_generated, integration_generated) = generate_integration()?; |
| 1023 | |
| 1024 | let tests_on_disk = std::fs::read_to_string(tests_fmf_path) |
| 1025 | .with_context(|| format!("Reading {}", tests_fmf_path))?; |
| 1026 | let integration_on_disk = std::fs::read_to_string(integration_fmf_path) |
| 1027 | .with_context(|| format!("Reading {}", integration_fmf_path))?; |
| 1028 | |
| 1029 | if tests_generated != tests_on_disk { |
| 1030 | return out_of_sync_error(&format!("{tests_fmf_path} is out of date")); |
| 1031 | } |
| 1032 | if integration_generated != integration_on_disk { |
| 1033 | return out_of_sync_error(&format!("{integration_fmf_path} is out of date")); |
| 1034 | } |
| 1035 | |
| 1036 | Ok(()) |
| 1037 | } |
| 1038 | |
| 1039 | /// Generate tmt/plans/integration.fmf from test definitions |
| 1040 | #[context("Updating TMT integration.fmf")] |
no test coverage detected