Fix warnings (#64)

This commit is contained in:
adria0.eth 2020-09-30 13:10:54 +02:00 committed by GitHub
parent 03bfb012a1
commit 84f675021c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 1 deletions

View File

@ -240,6 +240,7 @@ where
} }
} }
/// run an json executive test
pub fn json_executive_test<H: FnMut(&str, HookType)>( pub fn json_executive_test<H: FnMut(&str, HookType)>(
path: &Path, path: &Path,
json_data: &[u8], json_data: &[u8],

View File

@ -19,12 +19,14 @@
mod chain; mod chain;
mod difficulty; mod difficulty;
mod executive; mod executive;
pub mod runner;
mod state; mod state;
mod test_common; mod test_common;
mod transaction; mod transaction;
mod trie; mod trie;
/// executor of ethereum/json tests
pub mod runner;
pub use self::{ pub use self::{
executive::json_executive_test, executive::json_executive_test,
test_common::{debug_include_test, find_json_files_recursive, HookType}, test_common::{debug_include_test, find_json_files_recursive, HookType},

View File

@ -59,6 +59,7 @@ impl std::ops::AddAssign for TestResult {
} }
} }
/// An executor of ethereum/json tests
pub struct TestRunner(EthereumTestSuite); pub struct TestRunner(EthereumTestSuite);
impl TestRunner { impl TestRunner {

View File

@ -27,6 +27,7 @@ pub enum HookType {
OnStop, OnStop,
} }
/// find all json files recursively from a path
pub fn find_json_files_recursive(path: &PathBuf) -> Vec<PathBuf> { pub fn find_json_files_recursive(path: &PathBuf) -> Vec<PathBuf> {
WalkDir::new(path) WalkDir::new(path)
.into_iter() .into_iter()
@ -36,6 +37,7 @@ pub fn find_json_files_recursive(path: &PathBuf) -> Vec<PathBuf> {
.collect::<Vec<PathBuf>>() .collect::<Vec<PathBuf>>()
} }
/// check if the test is selected to execute via TEST_DEBUG environment variable
pub fn debug_include_test(name: &str) -> bool { pub fn debug_include_test(name: &str) -> bool {
match std::env::var_os("TEST_DEBUG") { match std::env::var_os("TEST_DEBUG") {
Some(s) => s.to_string_lossy().split_terminator(",").any(|expr| { Some(s) => s.to_string_lossy().split_terminator(",").any(|expr| {