mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-09 11:25:55 +00:00
Add parsing (not executing) of deposit tests
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
use ef_tests::*;
|
||||
use rayon::prelude::*;
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use walkdir::WalkDir;
|
||||
|
||||
fn yaml_files_in_test_dir(dir: &str) -> Vec<PathBuf> {
|
||||
let mut base_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
base_path.push("eth2.0-spec-tests");
|
||||
base_path.push("tests");
|
||||
base_path.push(dir);
|
||||
fn yaml_files_in_test_dir(dir: &Path) -> Vec<PathBuf> {
|
||||
let base_path = PathBuf::from(env!("CARGO_MANIFEST_DIR"))
|
||||
.join("eth2.0-spec-tests")
|
||||
.join("tests")
|
||||
.join(dir);
|
||||
|
||||
assert!(
|
||||
base_path.exists(),
|
||||
@@ -34,7 +34,7 @@ fn yaml_files_in_test_dir(dir: &str) -> Vec<PathBuf> {
|
||||
#[test]
|
||||
#[cfg(feature = "fake_crypto")]
|
||||
fn ssz_generic() {
|
||||
yaml_files_in_test_dir("ssz_generic")
|
||||
yaml_files_in_test_dir(&Path::new("ssz_generic"))
|
||||
.into_par_iter()
|
||||
.for_each(|file| {
|
||||
Doc::assert_tests_pass(file);
|
||||
@@ -44,17 +44,28 @@ fn ssz_generic() {
|
||||
#[test]
|
||||
#[cfg(feature = "fake_crypto")]
|
||||
fn ssz_static() {
|
||||
yaml_files_in_test_dir("ssz_static")
|
||||
yaml_files_in_test_dir(&Path::new("ssz_static"))
|
||||
.into_par_iter()
|
||||
.for_each(|file| {
|
||||
Doc::assert_tests_pass(file);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(feature = "fake_crypto")]
|
||||
fn operations_deposit() {
|
||||
yaml_files_in_test_dir(&Path::new("operations").join("deposit"))
|
||||
// .into_par_iter()
|
||||
.into_iter()
|
||||
.for_each(|file| {
|
||||
Doc::assert_tests_pass(file);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(not(feature = "fake_crypto"))]
|
||||
fn bls() {
|
||||
yaml_files_in_test_dir("bls")
|
||||
yaml_files_in_test_dir(&Path::new("bls"))
|
||||
.into_par_iter()
|
||||
.for_each(|file| {
|
||||
Doc::assert_tests_pass(file);
|
||||
|
||||
Reference in New Issue
Block a user