Skip to content

Commit

Permalink
fixup! Extract workflow and improve argument parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
sayon committed Apr 22, 2024
1 parent 46384f0 commit 830f458
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion compiler_tester/src/compiler_tester/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::path::PathBuf;

use structopt::StructOpt;

use compiler_tester::workflow::Workflow;
use compiler_tester::Workflow;

///
/// The compiler tester arguments.
Expand Down
4 changes: 2 additions & 2 deletions compiler_tester/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ pub(crate) mod summary;
pub(crate) mod test;
pub(crate) mod utils;
pub(crate) mod vm;
pub mod workflow;
pub(crate) mod workflow;

pub use self::filters::Filters;
pub use self::llvm_options::LLVMOptions;
pub use self::summary::Summary;
pub use self::workflow::Workflow;
pub use crate::vm::eravm::deployers::native_deployer::NativeDeployer as EraVMNativeDeployer;
pub use crate::vm::eravm::deployers::system_contract_deployer::SystemContractDeployer as EraVMSystemContractDeployer;
pub use crate::vm::eravm::EraVM;
Expand All @@ -27,7 +28,6 @@ use std::sync::Mutex;
use itertools::Itertools;
use rayon::iter::IntoParallelIterator;
use rayon::iter::ParallelIterator;
use workflow::Workflow;

pub use crate::compilers::eravm::EraVMCompiler;
pub use crate::compilers::llvm::LLVMCompiler;
Expand Down
7 changes: 2 additions & 5 deletions compiler_tester/src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@ pub enum Workflow {
BuildAndRun,
}

// any error type implementing Display is acceptable.
type ParseError = &'static str;

impl FromStr for Workflow {
type Err = ParseError;
type Err = &'static str;

fn from_str(day: &str) -> Result<Self, Self::Err> {
match day {
"build" => Ok(Workflow::BuildOnly),
Expand Down
4 changes: 2 additions & 2 deletions fuzzer/fuzz_targets/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use std::{
sync::Arc,
};

use compiler_tester::Workflow;
use compiler_tester::{Buildable, EthereumTest, Mode, SolidityCompiler, SolidityMode, Summary};
use compiler_tester::workflow::Workflow;
pub use solidity_adapter::{
test::function_call::parser::{
lexical::token::{
Expand Down Expand Up @@ -174,7 +174,7 @@ pub fn build_and_run(test: EthereumTest) -> anyhow::Result<Summary> {
compiler_tester::Summary::new(true, false).wrap(),
compiler_tester::Filters::new(vec![], vec![], vec![]),
None,
Workflow::BuildAndRun
Workflow::BuildAndRun,
)?;
zkevm_tester::runners::compiler_tests::set_tracing_mode(
zkevm_tester::runners::compiler_tests::VmTracingOptions::from_u64(0),
Expand Down

0 comments on commit 830f458

Please sign in to comment.