Skip to content

Commit

Permalink
enhanced length warning
Browse files Browse the repository at this point in the history
  • Loading branch information
JanLJL committed Nov 6, 2020
1 parent 26ee005 commit c8c077a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions osaca/osaca.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ def inspect(args, output_file=sys.stdout):
print_length_warning = False
else:
kernel = reduce_to_section(parsed_code, isa)
# Print warning if kernel is larger than threshold
print_length_warning = True if len(kernel) > 200 else False
# Print warning if kernel has no markers and is larger than threshold (100)
print_length_warning = True if len(kernel) == len(parsed_code) and len(kernel) > 100 else False
machine_model = MachineModel(arch=arch)
semantics = ArchSemantics(machine_model)
semantics.add_semantics(kernel)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def test_user_warnings(self):
# WARNING for length
self.assertTrue(output.getvalue().count('WARNING') == 1)
args = parser.parse_args(
['--lines', '100-299', '--ignore-unknown', self._find_test_file(kernel)]
['--lines', '100-199', '--ignore-unknown', self._find_test_file(kernel)]
)
output = StringIO()
osaca.run(args, output_file=output)
Expand Down

0 comments on commit c8c077a

Please sign in to comment.