in src/producer.rs [894:940]
fn test_zip_producer_with_gcda_dir() {
let (sender, receiver) = unbounded();
let tmp_dir = tempfile::tempdir().expect("Failed to create temporary directory");
let tmp_path = tmp_dir.path().to_owned();
let mapping = producer(
&tmp_path,
&[
"test/zip_dir/gcno.zip".to_string(),
"test/zip_dir".to_string(),
],
&sender,
false,
false,
);
let expected = vec![
(ItemFormat::Gcno, true, "Platform_1.gcno", true),
(
ItemFormat::Gcno,
true,
"sub2/RootAccessibleWrap_1.gcno",
true,
),
(ItemFormat::Gcno, true, "nsMaiInterfaceValue_1.gcno", true),
(ItemFormat::Gcno, true, "sub/prova2_1.gcno", true),
(
ItemFormat::Gcno,
true,
"nsMaiInterfaceDocument_1.gcno",
true,
),
(ItemFormat::Gcno, true, "nsGnomeModule_1.gcno", true),
];
check_produced(tmp_path, &receiver, expected);
assert!(mapping.is_some());
let mapping: Value = serde_json::from_slice(&mapping.unwrap()).unwrap();
assert_eq!(
mapping
.get("dist/include/zlib.h")
.unwrap()
.as_str()
.unwrap(),
"modules/zlib/src/zlib.h"
);
}