Skip to content

Commit 1b04c7a

Browse files
committed
feat(separate_trace_types_crate): Moved tests test_binary_roundtrip_v0 and _v1 to the runtime_tracing_cli crate
1 parent 57aa904 commit 1b04c7a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

runtime_tracing/tests/binary_format.rs renamed to runtime_tracing_cli/tests/binary_format.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1-
use runtime_tracing::{TraceEventsFileFormat, TraceWriter, create_trace_reader, create_trace_writer};
21
use std::fs;
32
use std::path::Path;
43

5-
fn test_binary_roundtrip(ver: TraceEventsFileFormat, binfile: &str) {
4+
use codetracer_trace_reader::create_trace_reader;
5+
use codetracer_trace_writer::create_trace_writer;
6+
use codetracer_trace_writer::trace_writer::TraceWriter;
7+
8+
fn test_binary_roundtrip(ver: codetracer_trace_writer::TraceEventsFileFormat, binfile: &str) {
69
let json_path = Path::new("tests/data/trace.json");
710

8-
let mut json_reader = create_trace_reader(TraceEventsFileFormat::Json);
11+
let mut json_reader = create_trace_reader(codetracer_trace_reader::TraceEventsFileFormat::Json);
912
let original = json_reader.load_trace_events(json_path).unwrap();
1013

1114
let bin_path_str = format!("tests/data/{}", binfile);
@@ -16,7 +19,7 @@ fn test_binary_roundtrip(ver: TraceEventsFileFormat, binfile: &str) {
1619
TraceWriter::append_events(bin_writer.as_mut(), &mut original.clone());
1720
bin_writer.finish_writing_trace_events().unwrap();
1821

19-
let mut bin_reader = create_trace_reader(TraceEventsFileFormat::Binary);
22+
let mut bin_reader = create_trace_reader(codetracer_trace_reader::TraceEventsFileFormat::Binary);
2023
let tracer2_events = bin_reader.load_trace_events(bin_path).unwrap();
2124

2225
fs::remove_file(bin_path).unwrap();
@@ -29,10 +32,10 @@ fn test_binary_roundtrip(ver: TraceEventsFileFormat, binfile: &str) {
2932

3033
#[test]
3134
fn test_binary_roundtrip_v0() {
32-
test_binary_roundtrip(TraceEventsFileFormat::BinaryV0, "trace.v0.bin");
35+
test_binary_roundtrip(codetracer_trace_writer::TraceEventsFileFormat::BinaryV0, "trace.v0.bin");
3336
}
3437

3538
#[test]
3639
fn test_binary_roundtrip_v1() {
37-
test_binary_roundtrip(TraceEventsFileFormat::Binary, "trace.v1.bin");
40+
test_binary_roundtrip(codetracer_trace_writer::TraceEventsFileFormat::Binary, "trace.v1.bin");
3841
}
File renamed without changes.

0 commit comments

Comments
 (0)