mirror of
https://github.com/pezkuwichain/revive-differential-tests.git
synced 2026-05-09 18:17:57 +00:00
parsing complex tests works modulo the contract addresses in calldata
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -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>,
|
||||
}
|
||||
@@ -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(())
|
||||
}
|
||||
@@ -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;
|
||||
Reference in New Issue
Block a user