From 87e22ef8be01e423136c254bf02dc53923f167ff Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Fri, 10 May 2019 09:25:51 -0700 Subject: [PATCH] Add scalalib test code to mypy --- hammer_ir/scalalib/test/test_placement.py | 7 ++++++- src/test/mypy.sh | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/hammer_ir/scalalib/test/test_placement.py b/hammer_ir/scalalib/test/test_placement.py index 7d7cbd79d..f37fcfbf1 100755 --- a/hammer_ir/scalalib/test/test_placement.py +++ b/hammer_ir/scalalib/test/test_placement.py @@ -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, @@ -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())) diff --git a/src/test/mypy.sh b/src/test/mypy.sh index 4c6d166d9..c4b3345ba 100755 --- a/src/test/mypy.sh +++ b/src/test/mypy.sh @@ -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