parsing complex tests works modulo the contract addresses in calldata

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2025-03-19 16:23:04 +01:00
parent d08d6fd66f
commit 67f068ca12
15 changed files with 429 additions and 27 deletions
+17
View File
@@ -0,0 +1,17 @@
use std::path::PathBuf;
use clap::Parser;
#[derive(Debug, Parser)]
#[command(name = "The PolkaVM Solidity compiler", arg_required_else_help = true)]
pub struct Arguments {
/// The path where the `resolc` executable to be tested is found at.
///
/// By default it uses the `resolc` found in `$PATH`
#[arg(long = "resolc")]
pub resolc: Option<PathBuf>,
/// A list of test corpus JSON files to be tested.
#[arg(long = "corpus")]
pub corpus: Vec<PathBuf>,
}
+24
View File
@@ -0,0 +1,24 @@
use std::collections::BTreeSet;
use clap::Parser;
use revive_differential_testing_core::arguments::Arguments;
use revive_differential_testing_format::corpus::Corpus;
fn main() -> anyhow::Result<()> {
env_logger::init();
let args = Arguments::try_parse()?;
for path in args.corpus.iter().collect::<BTreeSet<_>>() {
log::trace!("attempting corpus {path:?}");
let corpus = Corpus::try_from_path(path)?;
log::info!("found corpus: {corpus:?}");
let tests = corpus.enumerate_tests();
log::debug!("{tests:?}");
}
Ok(())
}
+6
View File
@@ -0,0 +1,6 @@
//! The revive differential testing core library.
//!
//! This crate defines the testing configuration and
//! provides a helper utilty to execute tests.
pub mod arguments;