build: add differential tests against real dpkg-buildpackage
Add an automated differential test harness in build/mod.rs that builds the same source tree twice - once with real 'dpkg-buildpackage -S -I -i -nc -d --no-sign', once with the native pipeline - and compares all produced artifacts: - .dsc payload byte-for-byte, - .changes field-by-field (checksum lines of the .buildinfo itself excluded, as its content legitimately differs on machine-dependent fields), - .buildinfo structure (Installed-Build-Depends, Environment, Build-Date and Build-Tainted-By excluded).
This commit is contained in:
@@ -34,6 +34,8 @@ pub struct ChangesInput {
|
||||
pub changed_by: Option<String>,
|
||||
/// Formatted per-package description lines (empty for source-only).
|
||||
pub descriptions: Vec<String>,
|
||||
/// Bug numbers collected from the changelog (`Closes` field), if any.
|
||||
pub closes: Option<String>,
|
||||
/// Rendered `Changes` field value from the changelog entry.
|
||||
pub changes_field: String,
|
||||
/// Computed artifact checksums (dsc, tarballs, debs, buildinfo).
|
||||
@@ -111,6 +113,9 @@ pub fn render_changes(input: &ChangesInput) -> Paragraph {
|
||||
// Leading `\n`: pre-wrapped multiline field, dpkg-style.
|
||||
p.set("Description", &format!("\n{}", sorted.join("\n")));
|
||||
}
|
||||
if let Some(closes) = &input.closes {
|
||||
p.set("Closes", closes);
|
||||
}
|
||||
p.set("Changes", &input.changes_field);
|
||||
|
||||
if !input.checksums.is_empty() {
|
||||
@@ -199,6 +204,7 @@ mod tests {
|
||||
maintainer: Some("A B <a@b.c>".to_string()),
|
||||
changed_by: Some("A B <a@b.c>".to_string()),
|
||||
descriptions: vec![],
|
||||
closes: None,
|
||||
changes_field: "pkg (1.0) unstable; urgency=medium\n.\n * Something.".to_string(),
|
||||
checksums,
|
||||
files_list,
|
||||
|
||||
Reference in New Issue
Block a user