enhanced length warning

This commit is contained in:
JanLJL
2020-11-06 15:49:13 +01:00
parent 58b82699a6
commit 9b29c77b5d
2 changed files with 3 additions and 3 deletions

View File

@@ -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)

View File

@@ -177,7 +177,7 @@ class TestCLI(unittest.TestCase):
# 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)