Update ethereum/tests
This commit is contained in:
@@ -135,10 +135,15 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
let mut failed = Vec::new();
|
||||
|
||||
for (name, blockchain) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let skip_test = test
|
||||
.skip
|
||||
.iter()
|
||||
.any(|block_test| block_test.names.contains(&name));
|
||||
|
||||
if skip_test {
|
||||
info!(" SKIPPED {:?} {:?}", name, blockchain.network);
|
||||
continue;
|
||||
|
||||
@@ -37,6 +37,10 @@ pub fn json_difficulty_test<H: FnMut(&str, HookType)>(
|
||||
let engine = &spec.engine;
|
||||
|
||||
for (name, test) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
start_stop_hook(&name, HookType::OnStart);
|
||||
|
||||
let mut parent_header = Header::new();
|
||||
|
||||
@@ -252,6 +252,10 @@ pub fn json_executive_test<H: FnMut(&str, HookType)>(
|
||||
let mut failed = Vec::new();
|
||||
|
||||
for (name, vm) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
start_stop_hook(&format!("{}", name), HookType::OnStart);
|
||||
|
||||
let mut fail = false;
|
||||
|
||||
@@ -27,5 +27,5 @@ mod trie;
|
||||
|
||||
pub use self::{
|
||||
executive::json_executive_test,
|
||||
test_common::{find_json_files_recursive, HookType},
|
||||
test_common::{debug_include_test, find_json_files_recursive, HookType},
|
||||
};
|
||||
|
||||
@@ -236,7 +236,10 @@ fn ethereum_json_tests() {
|
||||
let runner =
|
||||
TestRunner::load(content.as_slice()).expect("cannot load ethereum tests spec file");
|
||||
println!("----------------------------------------------------");
|
||||
let result = runner.run();
|
||||
let result = match std::env::var_os("TEST_DEBUG") {
|
||||
Some(_) => runner.run_without_par(),
|
||||
_ => runner.run(),
|
||||
};
|
||||
println!("----------------------------------------------------");
|
||||
flushln!(
|
||||
"SUCCESS: {} FAILED: {} {:?}",
|
||||
|
||||
@@ -56,6 +56,10 @@ pub fn json_chain_test<H: FnMut(&str, HookType)>(
|
||||
let mut failed = Vec::new();
|
||||
|
||||
for (name, test) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
start_stop_hook(&name, HookType::OnStart);
|
||||
|
||||
{
|
||||
|
||||
@@ -35,3 +35,14 @@ pub fn find_json_files_recursive(path: &PathBuf) -> Vec<PathBuf> {
|
||||
.map(DirEntry::into_path)
|
||||
.collect::<Vec<PathBuf>>()
|
||||
}
|
||||
|
||||
pub fn debug_include_test(name: &str) -> bool {
|
||||
match std::env::var_os("TEST_DEBUG") {
|
||||
Some(s) => s.to_string_lossy().split_terminator(",").any(|expr| {
|
||||
regex::Regex::new(expr)
|
||||
.expect("invalid regex expression in TEST_DEBUG")
|
||||
.is_match(name)
|
||||
}),
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,10 @@ pub fn json_transaction_test<H: FnMut(&str, HookType)>(
|
||||
));
|
||||
let mut failed = Vec::new();
|
||||
for (name, test) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
start_stop_hook(&name, HookType::OnStart);
|
||||
|
||||
println!(" - tx: {} ", name);
|
||||
|
||||
@@ -36,6 +36,10 @@ pub fn json_trie_test<H: FnMut(&str, HookType)>(
|
||||
let mut failed = vec![];
|
||||
|
||||
for (name, test) in tests.into_iter() {
|
||||
if !super::debug_include_test(&name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
start_stop_hook(&name, HookType::OnStart);
|
||||
|
||||
let mut memdb = journaldb::new_memory_db();
|
||||
|
||||
Reference in New Issue
Block a user