From 5721b8042721267316b282f2f3332e134684d2a3 Mon Sep 17 00:00:00 2001 From: Mikhail Sobolev Date: Sat, 30 Aug 2014 12:36:20 +0300 Subject: [PATCH] make the default warning pattern case insensitive * WarningCountingShellCommand is a generic class so it seems reasonable to catch as many warnings as possible --- master/buildbot/steps/shell.py | 2 +- master/buildbot/test/unit/test_steps_shell.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/master/buildbot/steps/shell.py b/master/buildbot/steps/shell.py index 1e8ccd8e2e9..37495111f6d 100644 --- a/master/buildbot/steps/shell.py +++ b/master/buildbot/steps/shell.py @@ -400,7 +400,7 @@ class WarningCountingShellCommand(ShellCommand): renderables = ['suppressionFile'] warnCount = 0 - warningPattern = '.*warning[: ].*' + warningPattern = '(?i).*warning[: ].*' # The defaults work for GNU Make. directoryEnterPattern = (u"make.*: Entering directory " u"[\u2019\"`'](.*)[\u2019'`\"]") diff --git a/master/buildbot/test/unit/test_steps_shell.py b/master/buildbot/test/unit/test_steps_shell.py index 8991e4c51ca..16f107bff15 100644 --- a/master/buildbot/test/unit/test_steps_shell.py +++ b/master/buildbot/test/unit/test_steps_shell.py @@ -703,12 +703,14 @@ def test_default_pattern(self): ExpectShell(workdir='wkdir', usePTY='slave-config', command=["make"]) + ExpectShell.log('stdio', - stdout='normal: foo\nwarning: blarg!\nalso normal') + stdout='normal: foo\nwarning: blarg!\n' + 'also normal\nWARNING: blarg!\n') + 0 ) self.expectOutcome(result=WARNINGS, status_text=["'make'", "warnings"]) - self.expectProperty("warnings-count", 1) - self.expectLogfile("warnings (1)", "warning: blarg!\n") + self.expectProperty("warnings-count", 2) + self.expectLogfile("warnings (2)", + "warning: blarg!\nWARNING: blarg!\n") return self.runStep() def test_custom_pattern(self):