Skip to content

Commit

Permalink
gas_diff_stats.py: Fail when the semantic test dir does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
cameel committed Feb 21, 2024
1 parent 5518a30 commit 39f3e76
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scripts/gas_diff_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ class Diff(Enum):
Minus = 1
Plus = 2

SEMANTIC_TEST_DIR = Path("test/libsolidity/semanticTests/")

minus = string("-").result(Diff.Minus)
plus = string("+").result(Diff.Plus)

Expand Down Expand Up @@ -119,7 +121,10 @@ def stat(old, new):

table = []

for path in Path("test/libsolidity/semanticTests").rglob("*.sol"):
if not SEMANTIC_TEST_DIR.is_dir():
sys.exit(f"Semantic tests not found. '{SEMANTIC_TEST_DIR.absolute()}' is missing or not a directory.")

for path in SEMANTIC_TEST_DIR.rglob("*.sol"):
fname = path.as_posix()
parsed = try_parse_git_diff(fname)
if parsed is None:
Expand Down

0 comments on commit 39f3e76

Please sign in to comment.