Update state tests execution model (#9440)

* Update & fix JSON state tests.

* Update tests to be able to run ethtest at
021fe3d410773024cd5f0387e62db6e6ec800f32.

- Touch user in state
- Adjust transaction tests to new json format

* Switch to same commit for submodule ethereum/test as geth (next includes constantinople changes).
Added test `json_tests::trie::generic::TrieTests_trieanyorder` and a few
difficulty tests.

* Remove trietestnextprev as it would require to parse differently and
implement it.

* Support new (shitty) format of transaction tests.

* Ignore junk in ethereum/tests repo.

* Ignore incorrect test.

* Update to a later commit

* Move block number to a constant.

* Fix ZK2 test - touched account should also be cleared.

* Fix conflict resolution
This commit is contained in:
Tomasz Drwięga
2018-09-10 22:38:30 +02:00
committed by Afri Schoedon
parent ba487eaaca
commit 6e5a1c00dc
16 changed files with 221 additions and 138 deletions

View File

@@ -41,6 +41,7 @@ pub fn run_test_path<H: FnMut(&str, HookType)>(
os.push(".json");
os
}).collect();
let extension = path.extension().and_then(|s| s.to_str());
if path.is_dir() {
for p in read_dir(path).unwrap().filter_map(|e| {
let e = e.unwrap();
@@ -51,6 +52,8 @@ pub fn run_test_path<H: FnMut(&str, HookType)>(
}}) {
run_test_path(&p, skip, runner, start_stop_hook)
}
} else if extension == Some("swp") || extension == None {
// Ignore junk
} else {
let mut path = p.to_path_buf();
path.set_extension("json");
@@ -64,7 +67,10 @@ pub fn run_test_file<H: FnMut(&str, HookType)>(
start_stop_hook: &mut H
) {
let mut data = Vec::new();
let mut file = File::open(&path).expect("Error opening test file");
let mut file = match File::open(&path) {
Ok(file) => file,
Err(_) => panic!("Error opening test file at: {:?}", path),
};
file.read_to_end(&mut data).expect("Error reading test file");
let results = runner(&data, start_stop_hook);
let empty: [String; 0] = [];