Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: v1.5.8 #129

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: move BenchmarkFormat to the library
hedgar2017 committed Dec 20, 2024
commit c1829a92a8fdf5e7f529d788722ffecdd88806fc
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
//!
//! Output format for benchmark data.
//!

///
/// Output format for benchmark data.
#[derive(Clone, Debug, Default, Eq, PartialEq)]
///
#[derive(Debug, Default, Clone, PartialEq, Eq)]
pub enum BenchmarkFormat {
#[default]
/// JSON format.
Json,
/// CSV format.
Csv,
}

Original file line number Diff line number Diff line change
@@ -4,11 +4,8 @@

use std::path::PathBuf;

use benchmark_format::BenchmarkFormat;
use clap::Parser;

pub mod benchmark_format;

///
/// The compiler tester arguments.
///
@@ -44,8 +41,8 @@ pub struct Arguments {
pub benchmark: Option<PathBuf>,

/// The benchmark output format.
#[structopt(long = "benchmark-format", default_value_t = BenchmarkFormat::Json)]
pub benchmark_format: BenchmarkFormat,
#[structopt(long = "benchmark-format", default_value_t = compiler_tester::BenchmarkFormat::Json)]
pub benchmark_format: compiler_tester::BenchmarkFormat,

/// Sets the number of threads, which execute the tests concurrently.
#[structopt(short, long)]
9 changes: 4 additions & 5 deletions compiler_tester/src/compiler_tester/main.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,6 @@ use std::path::PathBuf;
use std::str::FromStr;
use std::time::Instant;

use arguments::benchmark_format::BenchmarkFormat;
use clap::Parser;
use colored::Colorize;

@@ -224,10 +223,10 @@ fn main_inner(arguments: Arguments) -> anyhow::Result<()> {
if let Some(path) = arguments.benchmark {
let benchmark = summary.benchmark(toolchain)?;
match arguments.benchmark_format {
BenchmarkFormat::Json => {
compiler_tester::BenchmarkFormat::Json => {
benchmark.write_to_file(path, benchmark_analyzer::JsonSerializer)?
}
BenchmarkFormat::Csv => {
compiler_tester::BenchmarkFormat::Csv => {
benchmark.write_to_file(path, benchmark_analyzer::CsvSerializer)?
}
}
@@ -244,7 +243,7 @@ fn main_inner(arguments: Arguments) -> anyhow::Result<()> {
mod tests {
use std::path::PathBuf;

use crate::arguments::{benchmark_format::BenchmarkFormat, Arguments};
use crate::arguments::Arguments;

#[test]
fn test_manually() {
@@ -258,7 +257,7 @@ mod tests {
path: vec!["tests/solidity/simple/default.sol".to_owned()],
group: vec![],
benchmark: None,
benchmark_format: BenchmarkFormat::Json,
benchmark_format: compiler_tester::BenchmarkFormat::Json,
threads: Some(1),
dump_system: false,
disable_deployer: false,
2 changes: 2 additions & 0 deletions compiler_tester/src/lib.rs
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
#![allow(clippy::too_many_arguments)]
#![allow(clippy::type_complexity)]

pub(crate) mod benchmark_format;
pub(crate) mod compilers;
pub(crate) mod directories;
pub(crate) mod environment;
@@ -26,6 +27,7 @@ use itertools::Itertools;
use rayon::iter::IntoParallelIterator;
use rayon::iter::ParallelIterator;

pub use crate::benchmark_format::BenchmarkFormat;
pub use crate::compilers::eravm::EraVMCompiler;
pub use crate::compilers::llvm::LLVMCompiler;
pub use crate::compilers::mode::llvm_options::LLVMOptions;