commit
71ccbf7cb0
|
|
@ -354,6 +354,7 @@ class rule_list():
|
|||
dTemp = {}
|
||||
dTemp['rule'] = oRule.unique_id
|
||||
dTemp['linenumber'] = oViolation.get_line_number()
|
||||
dTemp['severity'] = oRule.severity.name
|
||||
dTemp['solution'] = oViolation.get_solution()
|
||||
dReturn['violations'].append(dTemp)
|
||||
return dReturn
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"files": [
|
||||
{
|
||||
"file_path": "vsg/tests/vsg/entity2.vhd",
|
||||
"violations": [
|
||||
{
|
||||
"rule": "port_008",
|
||||
"linenumber": 8,
|
||||
"severity": "Error",
|
||||
"solution": "Change the number of spaces after the *out* keyword to three spaces."
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"file_path": "vsg/tests/vsg/entity_architecture.fixed.vhd",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"file_path": "vsg/tests/vsg/entity_architecture.vhd",
|
||||
"violations": []
|
||||
},
|
||||
{
|
||||
"file_path": "vsg/tests/vsg/entity1.vhd",
|
||||
"violations": [
|
||||
{
|
||||
"rule": "port_007",
|
||||
"linenumber": 7,
|
||||
"severity": "Error",
|
||||
"solution": "Change the number of spaces after the *in* keyword to four spaces."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -397,6 +397,18 @@ class testMain(unittest.TestCase):
|
|||
|
||||
self.assertTrue(os.path.isfile('deleteme.json'))
|
||||
|
||||
# Read in the expected JSON file for comparison
|
||||
lExpected = []
|
||||
utils.read_file(os.path.join(os.path.dirname(__file__),'json-expected.json'), lExpected)
|
||||
# Read in the actual JSON file for comparison
|
||||
lActual = []
|
||||
utils.read_file(os.path.join('deleteme.json'), lActual)
|
||||
|
||||
self.assertEqual(len(lExpected), len(lActual))
|
||||
|
||||
for sActual, sExpected in zip(lActual, lExpected):
|
||||
self.assertEqual(sActual, sExpected)
|
||||
|
||||
@mock.patch('sys.stdout')
|
||||
def test_backup_file(self, mock_stdout):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue