Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
antonbaliasnikov committed Jan 28, 2025
1 parent 6cbb575 commit a07374f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ pub struct Run {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub size: Option<usize>,
/// The number of cycles.
#[serde(default, skip_serializing_if = "is_zero_usize")]
pub cycles: usize,
/// The amount of ergs.
#[serde(default, skip_serializing_if = "is_zero")]
pub ergs: u64,
/// The amount of EVM gas.
#[serde(default, skip_serializing_if = "is_zero")]
Expand All @@ -26,6 +28,10 @@ fn is_zero(value: &u64) -> bool {
*value == 0
}

fn is_zero_usize(value: &usize) -> bool {
*value == 0
}

impl Run {
///
/// A shortcut constructor.
Expand Down
11 changes: 11 additions & 0 deletions benchmark_analyzer/src/output/format/json/lnt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ pub struct JsonLNT;
fn test_name(selector: &Selector, version: impl std::fmt::Display) -> String {
fn shorten_file_name(name: &str) -> String {
let path_buf = PathBuf::from(name);
if let Some(parent) = path_buf.parent() {
if let Some(file_name) = path_buf.file_name() {
if let Some(dir_name) = parent.file_name() {
return format!(
"{}/{}",
dir_name.to_string_lossy(),
file_name.to_string_lossy()
);
}
}
}
path_buf.to_str().expect("Always valid").to_string()
}
let Selector { path, case, input } = selector;
Expand Down

0 comments on commit a07374f

Please sign in to comment.