-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2de276d
commit ee61cd6
Showing
7 changed files
with
575 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
[workspace] | ||
resolver = "2" | ||
|
||
members = [ | ||
"ssz-rs", | ||
"ssz-rs-derive", | ||
"ssz-rs-test-gen" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "ssz-rs-test-gen" | ||
version = "0.1.0" | ||
edition = "2021" | ||
license = "MIT OR Apache-2.0" | ||
readme = "./README.md" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
serde = "1.0" | ||
serde_yaml = "0.9" | ||
num-bigint = "0.4.3" | ||
hex = "0.4.3" | ||
convert_case = "0.6.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# ssz-rs-test-gen | ||
|
||
Utility for generating the integration tests for `ssz_rs`. | ||
|
||
## How to use | ||
|
||
```bash | ||
just clean | ||
just download-integration-tests | ||
just generate-all | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
default-fmt := "true" | ||
|
||
generate-all: | ||
#!/usr/bin/env sh | ||
for TYP in basic_vector bitlist bitvector boolean containers uints; do | ||
just generate $TYP false | ||
done; | ||
just fmt | ||
generate TYPE FMT=default-fmt: | ||
cargo run -p ssz-rs-test-gen {{TYPE}} | ||
if {{FMT}} == true; then just fmt; fi | ||
|
||
fmt: | ||
cargo +nightly fmt --all | ||
|
||
generate-clean: | ||
rm -rf ../ssz-rs/tests/data | ||
|
||
download-integration-tests: integration-tests-clean | ||
#!/usr/bin/env sh | ||
TESTS_TAG=$(cat spec-test-version) | ||
REPO_NAME=consensus-spec-tests | ||
CONFIG="general" | ||
mkdir ${REPO_NAME} | ||
wget https://github.com/ethereum/${REPO_NAME}/releases/download/${TESTS_TAG}/${CONFIG}.tar.gz | ||
tar -xzf ${CONFIG}.tar.gz -C ${REPO_NAME} | ||
rm -f *tar.gz | ||
integration-tests-clean: | ||
rm -rf consensus-spec-tests | ||
|
||
clean: generate-clean integration-tests-clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
v1.3.0 |
Oops, something went wrong.