Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add test for archive compile options #49

Open
wants to merge 3 commits into
base: fix/vyz-formats
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions tests/unit/cli/vyper_compile/test_compile_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,31 @@ def test_archive_b64_output(input_files):
assert out[contract_file] == out2[archive_path]


def test_archive_compile_options(input_files):
tmpdir, _, _, contract_file = input_files
search_paths = [".", tmpdir]

options = ["abi_python", "json", "ast", "annotated_ast", "ir_json"]

for option in options:
out = compile_files([contract_file], ["archive_b64", option], paths=search_paths)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to actually check vyz compilation as well


archive_b64 = out[contract_file].pop("archive_b64")

archive_path = Path("foo.zip.b64")
with archive_path.open("w") as f:
f.write(archive_b64)

# compare compiling the two input bundles
out2 = compile_files([archive_path], [option])

if option in ["ast", "annotated_ast"]:
# would have to normalize paths and imports, so just verify it compiles
continue

assert out[contract_file] == out2[archive_path]


def test_solc_json_output(input_files):
tmpdir, _, _, contract_file = input_files
search_paths = [".", tmpdir]
Expand Down
Loading