Example #1
0
def roodi(dsc, analysis):
    run_command(["dpkg-source", "-x", dsc, "source-roodi"])
    with cd('source-roodi'):
        out, _, ret = run_command(['roodi', '.'])
        failed = ret != 0

        for issue in parse_roodi(out.splitlines()):
            analysis.results.append(issue)

        return (analysis, out, failed, None, None)
Example #2
0
def test_roodi_wrappers():
    ruby_analysis = test_roodi_common()
    issues = parse_roodi(ruby_analysis[1].splitlines())
    i = 0
    for issue in issues:
        if issue.location.file.givenpath == "./spec/support/builders.rb":
            found = issue
        i += 1
    assert found.location.file.givenpath == "./spec/support/builders.rb"
    assert found.location.point.line == 4
    assert found.location.point.column == 1
    assert found.severity == "warning"
    assert "Module \"Builders\" has 648 lines.  It should have 300 or less" in found.message.text
    assert found.notes is None
    assert found.trace is None
    assert found.customfields is None
    assert i > 100
Example #3
0
 def test_roodi_wrappers(self):
     ruby_analysis = roodi(self.file_path, self.firehose_results)
     issues = parse_roodi(ruby_analysis[1].splitlines())
     i = 0
     for issue in issues:
         if issue.location.file.givenpath == "./spec/support/builders.rb":
             found = issue
         i += 1
     self.assertEquals(found.location.file.givenpath,
             "./spec/support/builders.rb")
     self.assertEquals(found.location.point.line, 4)
     self.assertEquals(found.location.point.column, 1)
     self.assertEquals(found.severity, "warning")
     self.assertTrue("Module \"Builders\" has 648 lines.  It should have 300 or less"
             in found.message.text)
     self.assertIsNone(found.notes)
     self.assertIsNone(found.trace)
     self.assertIsNone(found.customfields)
     self.assertTrue(i > 100)