Skip to content

Commit

Permalink
Add scalalib test code to mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardcwang committed May 11, 2019
1 parent 14f70a1 commit b996094
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion hammer_ir/scalalib/test/test_placement.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ def run_scala(scala: str) -> None:
prep()

# Generate some constraints
# TODO(edwardw): test optional stuff
c1 = PlacementConstraint(
path="Top/rtl/a/b",
type=PlacementConstraintType.Placement,
Expand All @@ -47,6 +46,12 @@ def run_scala(scala: str) -> None:
obs_types=None
)

# TODO(edwardw): the optional parameters are only valid for certain
# types of constraints.
# e.g. orientation is only valid for hardmacros
# e.g. obs_types is only valid for obstructions
# We need to create some extra testcases to capture those usecases.

# Export to JSON
with open("tmp_c1.json", "w") as f:
f.write(json.dumps(c1.to_dict()))
Expand Down
3 changes: 3 additions & 0 deletions src/test/mypy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ call_mypy ../hammer-vlsi/par/mockpar/__init__.py
call_mypy ../hammer-vlsi/drc/*.py
call_mypy ../hammer-vlsi/lvs/*.py

# Scala library
call_mypy ../../hammer_ir/scalalib/test/*.py

# Plugins which may or may not exist
if [ -f ../hammer-vlsi/synthesis/dc/__init__.py ]; then
call_mypy ../hammer-vlsi/synthesis/dc/__init__.py
Expand Down

0 comments on commit b996094

Please sign in to comment.