Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit cf78a15

Browse files
author
adria0
committed
Fix deps
1 parent e1c9b76 commit cf78a15

File tree

5 files changed

+35
-19
lines changed

5 files changed

+35
-19
lines changed

ethcore/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ unexpected = { path = "../util/unexpected" }
6767
using_queue = { path = "../miner/using-queue" }
6868
verification = { path = "./verification" }
6969
vm = { path = "vm" }
70-
walkdir = "2.3.1"
70+
walkdir = { version = "2.3.1", optional = true }
7171

7272
[dev-dependencies]
7373
account-db = { path = "account-db" }
@@ -115,7 +115,7 @@ evm-debug-tests = ["evm-debug", "evm/evm-debug-tests"]
115115
# EVM debug traces are printed.
116116
slow-blocks = []
117117
# Run JSON consensus tests.
118-
json-tests = ["env_logger", "test-helpers", "lazy_static", "machine/test-helpers", "common-types/test-helpers"]
118+
json-tests = ["env_logger", "test-helpers", "walkdir", "machine/test-helpers", "common-types/test-helpers"]
119119
# Run memory/cpu heavy tests.
120120
test-heavy = []
121121
# Compile test helpers

ethcore/res/ethereum/tests

Submodule tests updated 13763 files

ethcore/src/json_tests/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ mod test_common;
2626
mod transaction;
2727
mod trie;
2828
mod difficulty;
29-
pub mod runner;
29+
mod runner;
3030

3131
pub use self::executive::run_test_path as run_executive_test_path;
3232
pub use self::executive::run_test_file as run_executive_test_file;

ethcore/src/json_tests/runner.rs

+23-13
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,44 @@
1313

1414
// You should have received a copy of the GNU General Public License
1515
// along with Open Ethereum. If not, see <http://www.gnu.org/licenses/>.
16+
#![allow(dead_code)]
1617

1718
use ethjson::test_helpers::ethspec::{
1819
ChainTests, DifficultyTests, EthereumTestSuite, ExecutiveTests, StateTests, TestChainSpec,
1920
TestTrieSpec, TransactionTests, TrieTests,
2021
};
2122
use globset::Glob;
22-
use log::{info, warn};
23+
use log::info;
2324
use rayon::prelude::*;
2425
use std::path::{Path, PathBuf};
2526
use tempfile::tempdir;
2627
use trie::TrieSpec;
2728
use walkdir::{DirEntry, WalkDir};
2829

30+
/// Result of tests execution
2931
pub struct TestResult {
32+
/// Number of success execution
3033
pub success: usize,
34+
/// Number of success execution
3135
pub failed: Vec<String>,
3236
}
3337

3438
impl TestResult {
39+
/// Creates a new TestResult without results
3540
pub fn zero() -> Self {
3641
TestResult {
3742
success: 0,
3843
failed: Vec::new(),
3944
}
4045
}
46+
/// Creates a new success TestResult
4147
pub fn success() -> Self {
4248
TestResult {
4349
success: 1,
4450
failed: Vec::new(),
4551
}
4652
}
53+
/// Creates a new failed TestResult
4754
pub fn failed(name: &str) -> Self {
4855
TestResult {
4956
success: 0,
@@ -73,13 +80,15 @@ impl std::ops::AddAssign for TestResult {
7380
pub struct TestRunner(EthereumTestSuite);
7481

7582
impl TestRunner {
83+
/// Loads a new JSON Test suite
7684
pub fn load<R>(reader: R) -> Result<Self, serde_json::Error>
7785
where
7886
R: std::io::Read,
7987
{
8088
Ok(TestRunner(serde_json::from_reader(reader)?))
8189
}
8290

91+
/// Run the tests with one thread
8392
pub fn run_without_par(&self) -> TestResult {
8493
let pool = rayon::ThreadPoolBuilder::new()
8594
.num_threads(1)
@@ -88,6 +97,7 @@ impl TestRunner {
8897
pool.install(|| self.run())
8998
}
9099

100+
/// Run the tests
91101
pub fn run(&self) -> TestResult {
92102
let mut res = TestResult::zero();
93103
for t in &self.0.chain {
@@ -120,10 +130,6 @@ impl TestRunner {
120130
.collect::<Vec<PathBuf>>()
121131
}
122132

123-
fn report_failed_tests(path: &Path, list: &Vec<String>) {
124-
warn!("FAILED TESTS FOR {:?}: {:?} ", path, list);
125-
}
126-
127133
fn run1<T, F>(test: &T, base_path: &str, f: F) -> TestResult
128134
where
129135
T: Send + Sync,
@@ -149,7 +155,7 @@ impl TestRunner {
149155
result
150156
}
151157

152-
pub fn in_set(path: &Path, exprs: &[String]) -> bool {
158+
fn in_set(path: &Path, exprs: &[String]) -> bool {
153159
for pathexp in exprs {
154160
let glob = Glob::new(&pathexp)
155161
.expect(&format!("cannot parse expression {}", pathexp))
@@ -161,7 +167,7 @@ impl TestRunner {
161167
false
162168
}
163169

164-
pub fn run_chain_tests(test: &ChainTests) -> TestResult {
170+
fn run_chain_tests(test: &ChainTests) -> TestResult {
165171
Self::run1(
166172
test,
167173
&test.path,
@@ -176,7 +182,8 @@ impl TestRunner {
176182
},
177183
)
178184
}
179-
pub fn run_state_tests(test: &StateTests) -> TestResult {
185+
186+
fn run_state_tests(test: &StateTests) -> TestResult {
180187
Self::run1(
181188
test,
182189
&test.path,
@@ -191,7 +198,8 @@ impl TestRunner {
191198
},
192199
)
193200
}
194-
pub fn run_difficuly_tests(test: &DifficultyTests) -> TestResult {
201+
202+
fn run_difficuly_tests(test: &DifficultyTests) -> TestResult {
195203
let mut acc = TestResult::zero();
196204
for path in &test.path {
197205
acc += Self::run1(
@@ -213,7 +221,7 @@ impl TestRunner {
213221
acc
214222
}
215223

216-
pub fn run_executive_tests(test: &ExecutiveTests) -> TestResult {
224+
fn run_executive_tests(test: &ExecutiveTests) -> TestResult {
217225
Self::run1(
218226
test,
219227
&test.path,
@@ -222,16 +230,18 @@ impl TestRunner {
222230
},
223231
)
224232
}
225-
pub fn run_transaction_tests(test: &TransactionTests) -> TestResult {
233+
234+
fn run_transaction_tests(test: &TransactionTests) -> TestResult {
226235
Self::run1(
227236
test,
228237
&test.path,
229-
|test: &TransactionTests, path: &Path, json: &[u8]| {
238+
|_: &TransactionTests, path: &Path, json: &[u8]| {
230239
super::transaction::do_json_test(&path, &json, &mut |_, _| {})
231240
},
232241
)
233242
}
234-
pub fn run_trie_tests(test: &TrieTests) -> TestResult {
243+
244+
fn run_trie_tests(test: &TrieTests) -> TestResult {
235245
let mut acc = TestResult::zero();
236246
for path in &test.path {
237247
acc += Self::run1(test, &path, |test: &TrieTests, path: &Path, json: &[u8]| {

ethcore/src/lib.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extern crate ethcore_miner;
3131
extern crate ethereum_types;
3232
extern crate executive_state;
3333
extern crate futures;
34-
extern crate globset;
3534
extern crate hash_db;
3635
extern crate itertools;
3736
extern crate journaldb;
@@ -52,14 +51,21 @@ extern crate serde;
5251
extern crate snapshot;
5352
extern crate spec;
5453
extern crate state_db;
55-
extern crate tempfile;
5654
extern crate trace;
5755
extern crate trie_vm_factories;
5856
extern crate triehash_ethereum as triehash;
5957
extern crate unexpected;
6058
extern crate using_queue;
6159
extern crate verification;
6260
extern crate vm;
61+
62+
#[cfg(feature = "json-tests")]
63+
extern crate globset;
64+
65+
#[cfg(feature = "json-tests")]
66+
extern crate tempfile;
67+
68+
#[cfg(feature = "json-tests")]
6369
extern crate walkdir;
6470

6571
#[cfg(test)]

0 commit comments

Comments
 (0)