mirror of
https://github.com/pevans/erc-c.git
synced 2024-11-23 23:32:45 +00:00
Clarify test conditions; allow docblock on line above
This commit is contained in:
parent
0fa930b548
commit
2c3503e752
@ -74,11 +74,18 @@ def test_name_from_func(suite, func):
|
|||||||
# not. (Which we can determine because there should be a closing comment
|
# not. (Which we can determine because there should be a closing comment
|
||||||
# token on the line above the type.)
|
# token on the line above the type.)
|
||||||
def has_doc_block(lines, linenum):
|
def has_doc_block(lines, linenum):
|
||||||
return linenum-2 >= 0 and lines[linenum-2] == ' */'
|
return linenum-2 >= 0 and (lines[linenum-2] == ' */' or lines[linenum-1] == ' */')
|
||||||
|
|
||||||
# Do we have a test for this function? The fname is the test file, and
|
# Do we have a test for this function? The fname is the test file, and
|
||||||
# the suite and test are -- well, what they are.
|
# the suite and test are -- well, what they are.
|
||||||
def has_test(fname, suite, test):
|
def has_test(fname, suite, test):
|
||||||
|
# This is a bit of fakery, but inspect-c is not (yet) smart enough
|
||||||
|
# to know that a macro like `DEFINE_ADDR(xyz)` expands to
|
||||||
|
# `mos6502_resolve_xyz` and that the test it should associate is
|
||||||
|
# that. So we skip macro function definitions for now.
|
||||||
|
if test.isupper():
|
||||||
|
return True
|
||||||
|
|
||||||
data = ''
|
data = ''
|
||||||
with open(fname, 'r') as f:
|
with open(fname, 'r') as f:
|
||||||
data = f.read()
|
data = f.read()
|
||||||
|
Loading…
Reference in New Issue
Block a user