-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from melexis/verbose-flag
Add verbose flag
- Loading branch information
Showing
9 changed files
with
156 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
======= | ||
Authors | ||
======= | ||
|
||
Melexis Warnings plugin is mainly maintained by: | ||
|
||
- Bavo Van Achte | ||
- Crt Mori | ||
- Stein Heselmans | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="1" name="test_warn_plugin_double_fail" skips="0" tests="2" time="33"> | ||
<testcase classname="test_warn_plugin_double_fail.foo" name="foo" time="22"/> | ||
<testcase classname="test_warn_plugin_double_fail.bar" name="bar" time="44"> | ||
<testcase classname="test_warn_plugin_double_fail" name="myfirstgreatsu66ess" time="22"/> | ||
<testcase classname="test_warn_plugin_double_fail" name="myfirstfai1ure" time="44"> | ||
<failure message="Is our warnings plugin able to trace this random failure msg?" /> | ||
</testcase> | ||
</testsuite> | ||
<testsuite errors="0" failures="0" name="test_warn_plugin_no_double_fail" skips="0" tests="1" time="33"> | ||
<testcase classname="test_warn_plugin_double_fail.john" name="john" time="33"> | ||
<testcase classname="test_warn_plugin_no_double_fail" name="mysecondfai1ure" time="33"> | ||
<failure message="Second failure">This time there is more content to the failure</failure> | ||
</testcase> | ||
<testcase classname="test_warn_plugin_no_double_fail.doe" name="doe" time="77"/> | ||
<testcase classname="test_warn_plugin_no_double_fail" name="mysecondgreatsu66ess" time="77"/> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="0" name="test_warn_plugin_no_failures" skipped="0" tests="2" time="33"> | ||
<testcase classname="test_warn_plugin_ok.foo" name="foo" time="22"/> | ||
<testcase classname="test_warn_plugin_ok.foo" name="bar" time="44"/> | ||
<testsuite errors="0" failures="0" name="test_warn_plugin_ok" skipped="0" tests="2" time="33"> | ||
<testcase classname="test_warn_plugin_ok" name="foo" time="22"/> | ||
<testcase classname="test_warn_plugin_ok" name="bar" time="44"/> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version='1.0' encoding='utf-8'?> | ||
<testsuites> | ||
<testsuite errors="0" failures="1" name="test_warn_plugin_single_fail" skips="0" tests="2" time="33"> | ||
<testcase classname="test_warn_plugin_single_fail.foo" name="foo" time="22"/> | ||
<testcase classname="test_warn_plugin_single_fail.bar" name="bar" time="44"> | ||
<testcase classname="test_warn_plugin_single_fail" name="myfirstgreatsu66ess" time="22"/> | ||
<testcase classname="test_warn_plugin_single_fail" name="myfirstfai1ure" time="44"> | ||
<failure message="Is our warnings plugin able to trace this random failure msg?" /> | ||
</testcase> | ||
</testsuite> | ||
<testsuite errors="0" failures="0" name="test_warn_plugin_no_single_fail" skips="0" tests="1" time="33"> | ||
<testcase classname="test_warn_plugin_no_single_fail.john" name="john" time="33"/> | ||
<testcase classname="test_warn_plugin_no_single_fail" name="mysecondgreatsu66ess" time="33"/> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,50 @@ | ||
try: | ||
from StringIO import StringIO | ||
except ImportError: | ||
from io import StringIO | ||
from mock import patch | ||
from unittest import TestCase | ||
|
||
from mlx.warnings import WarningsPlugin | ||
|
||
|
||
class TestDoxygenWarnings(TestCase): | ||
def setUp(self): | ||
self.warnings = WarningsPlugin(False, True, False) | ||
print(str(self.warnings)) | ||
self.warnings = WarningsPlugin(doxygen=True, verbose=True) | ||
|
||
def test_no_warning(self): | ||
self.warnings.check('This should not be treated as warning') | ||
dut = 'This should not be treated as warning' | ||
self.warnings.check(dut) | ||
self.assertEqual(self.warnings.return_count(), 0) | ||
|
||
def test_single_warning(self): | ||
self.warnings.check('testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"') | ||
dut = 'testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"' | ||
with patch('sys.stdout', new=StringIO()) as fake_out: | ||
self.warnings.check(dut) | ||
self.assertEqual(self.warnings.return_count(), 1) | ||
self.assertRegexpMatches(fake_out.getvalue(), dut) | ||
|
||
def test_single_warning_mixed(self): | ||
self.warnings.check('This1 should not be treated as warning') | ||
self.warnings.check('testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"') | ||
self.warnings.check('This should not be treated as warning2') | ||
dut1 = 'This1 should not be treated as warning' | ||
dut2 = 'testfile.c:6: warning: group test: ignoring title "Some test functions" that does not match old title "Some freaky test functions"' | ||
dut3 = 'This should not be treated as warning2' | ||
with patch('sys.stdout', new=StringIO()) as fake_out: | ||
self.warnings.check(dut1) | ||
self.warnings.check(dut2) | ||
self.warnings.check(dut3) | ||
self.assertEqual(self.warnings.return_count(), 1) | ||
self.assertRegexpMatches(fake_out.getvalue(), dut2) | ||
|
||
def test_multiline(self): | ||
duterr1 = "testfile.c:6: warning: group test: ignoring title \"Some test functions\" that does not match old title \"Some freaky test functions\"\n" | ||
duterr2 = "testfile.c:8: warning: group test: ignoring title \"Some test functions\" that does not match old title \"Some freaky test functions\"\n" | ||
dut = "This1 should not be treated as warning\n" | ||
dut += duterr1 | ||
dut += "This should not be treated as warning2\n" | ||
dut += duterr2 | ||
with patch('sys.stdout', new=StringIO()) as fake_out: | ||
self.warnings.check(dut) | ||
self.assertEqual(self.warnings.return_count(), 2) | ||
self.assertRegexpMatches(fake_out.getvalue(), duterr1) | ||
self.assertRegexpMatches(fake_out.getvalue(), duterr2) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.