From 64e0a8734f8bd5d479f9c3ac41bddfd00cd37b2c Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 4 Apr 2012 09:53:10 -0500 Subject: [PATCH] Report warnings as well as errors --- tool/test/org/antlr/v4/test/BaseTest.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tool/test/org/antlr/v4/test/BaseTest.java b/tool/test/org/antlr/v4/test/BaseTest.java index a26d63303..0ee9561f9 100644 --- a/tool/test/org/antlr/v4/test/BaseTest.java +++ b/tool/test/org/antlr/v4/test/BaseTest.java @@ -402,7 +402,7 @@ public abstract class BaseTest { Tool antlr = newTool(optionsA); antlr.addListener(equeue); antlr.processGrammarsOnCommandLine(); - if ( equeue.errors.size()>0 ) { + if ( !equeue.errors.isEmpty() ) { allIsWell = false; System.err.println("antlr reports errors from "+options); for (int i = 0; i < equeue.errors.size(); i++) { @@ -413,6 +413,13 @@ public abstract class BaseTest { System.out.println(grammarStr); System.out.println("###"); } + if ( !equeue.warnings.isEmpty() ) { + System.err.println("antlr reports warnings from "+options); + for (int i = 0; i < equeue.warnings.size(); i++) { + ANTLRMessage msg = equeue.warnings.get(i); + System.err.println(msg); + } + } } catch (Exception e) { allIsWell = false;