Fix Doxyfile parsing when the first tag occurs on the first line.
Also, add a couple of regression tests.
This commit is contained in:
parent
0d12211c55
commit
3926ea513a
2 changed files with 28 additions and 2 deletions
|
|
@ -58,9 +58,9 @@ def DoxyfileParse(file_contents):
|
|||
|
||||
lineno = lex.lineno
|
||||
token = lex.get_token()
|
||||
key = token # the first token should be a key
|
||||
key = None
|
||||
last_token = ""
|
||||
key_token = False
|
||||
key_token = True # the first token should be a key
|
||||
next_key = False
|
||||
new_data = True
|
||||
|
||||
|
|
|
|||
26
test.py
Executable file
26
test.py
Executable file
|
|
@ -0,0 +1,26 @@
|
|||
#!/usr/bin/python
|
||||
#
|
||||
# tests for scons doxygen builder
|
||||
#
|
||||
|
||||
import unittest
|
||||
import os
|
||||
import sys
|
||||
from doxygen import DoxyfileParse
|
||||
|
||||
class TestParser(unittest.TestCase):
|
||||
def testSimpleParse(self):
|
||||
text="""
|
||||
INPUT = test.h
|
||||
"""
|
||||
result = DoxyfileParse(text)
|
||||
self.assertEqual(["test.h"], result["INPUT"])
|
||||
|
||||
def testParseTagOnFirstLine(self):
|
||||
text="""INPUT=."""
|
||||
result = DoxyfileParse(text)
|
||||
self.assertEqual(["."], result["INPUT"])
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Loading…
Reference in a new issue