From 013977a53fc0b40ae4b3460bdb0821175aae16e3 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 10 Aug 2026 14:30:18 +0200 Subject: [PATCH] fus/odin/pit: Symlink in test-data from project root Test: cargo package && cargo build && cargo test --- fus/src/xml.rs | 10 ++++++++-- fus/test-data | 1 + odin/src/usb/mock.rs | 5 ++++- odin/test-data | 1 + pit/src/lib.rs | 5 ++++- pit/test-data | 1 + 6 files changed, 19 insertions(+), 4 deletions(-) create mode 120000 fus/test-data create mode 120000 odin/test-data create mode 120000 pit/test-data diff --git a/fus/src/xml.rs b/fus/src/xml.rs index 91633c0..c8e57b4 100644 --- a/fus/src/xml.rs +++ b/fus/src/xml.rs @@ -327,7 +327,10 @@ mod tests { #[test] fn test_parse_version_xml() { - let xml_content = include_str!("../../test-data/version.xml"); + let xml_content = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/test-data/version.xml" + )); let info = parse_version_xml(xml_content).unwrap(); assert_eq!( @@ -352,7 +355,10 @@ mod tests { #[test] fn test_parse_history_xml() { - let xml_content = include_str!("../../test-data/history.xml"); + let xml_content = include_str!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/test-data/history.xml" + )); let info = parse_history_xml(xml_content).unwrap(); assert_eq!( diff --git a/fus/test-data b/fus/test-data new file mode 120000 index 0000000..92e397c --- /dev/null +++ b/fus/test-data @@ -0,0 +1 @@ +../test-data \ No newline at end of file diff --git a/odin/src/usb/mock.rs b/odin/src/usb/mock.rs index 5f3e4ce..3c76e35 100644 --- a/odin/src/usb/mock.rs +++ b/odin/src/usb/mock.rs @@ -55,7 +55,10 @@ impl MockBackend { outgoing_queue: VecDeque::new(), current_part_index: 0, packet_size: 0x20000, // default Loke part size - pit_data: include_bytes!("../../../test-data/Q7MQ_EUR_OPENX.pit"), + pit_data: include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/test-data/Q7MQ_EUR_OPENX.pit" + )), } } diff --git a/odin/test-data b/odin/test-data new file mode 120000 index 0000000..92e397c --- /dev/null +++ b/odin/test-data @@ -0,0 +1 @@ +../test-data \ No newline at end of file diff --git a/pit/src/lib.rs b/pit/src/lib.rs index 5b2c77b..f8e4301 100644 --- a/pit/src/lib.rs +++ b/pit/src/lib.rs @@ -329,7 +329,10 @@ mod tests { #[test] fn test_pit_repack() { - let original_bytes = include_bytes!("../../test-data/Q7MQ_EUR_OPENX.pit"); + let original_bytes = include_bytes!(concat!( + env!("CARGO_MANIFEST_DIR"), + "/test-data/Q7MQ_EUR_OPENX.pit" + )); let pit_data = PitData::new(original_bytes).expect("Failed to parse original PIT"); let repacked_bytes = pit_data.pack().expect("Failed to repack PIT"); diff --git a/pit/test-data b/pit/test-data new file mode 120000 index 0000000..92e397c --- /dev/null +++ b/pit/test-data @@ -0,0 +1 @@ +../test-data \ No newline at end of file