groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: provide slightly more error information when stub test case fails
Date Tue, 19 Jun 2018 07:37:08 GMT
Repository: groovy
Updated Branches:
  refs/heads/master c59c12c4d -> 93d9ba1e5


provide slightly more error information when stub test case fails


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/93d9ba1e
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/93d9ba1e
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/93d9ba1e

Branch: refs/heads/master
Commit: 93d9ba1e5048e99841d3f957f0dac69c2173b863
Parents: c59c12c
Author: Paul King <paulk@asert.com.au>
Authored: Tue Jun 19 17:35:16 2018 +1000
Committer: Paul King <paulk@asert.com.au>
Committed: Tue Jun 19 17:36:57 2018 +1000

----------------------------------------------------------------------
 .../groovy/tools/stubgenerator/StubTestCase.groovy   | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/93d9ba1e/src/test/org/codehaus/groovy/tools/stubgenerator/StubTestCase.groovy
----------------------------------------------------------------------
diff --git a/src/test/org/codehaus/groovy/tools/stubgenerator/StubTestCase.groovy b/src/test/org/codehaus/groovy/tools/stubgenerator/StubTestCase.groovy
index 2ecbef5..6e8f288 100644
--- a/src/test/org/codehaus/groovy/tools/stubgenerator/StubTestCase.groovy
+++ b/src/test/org/codehaus/groovy/tools/stubgenerator/StubTestCase.groovy
@@ -159,6 +159,7 @@ abstract class StubTestCase extends GroovyTestCase {
             }
         }
 
+        Throwable compileError = null
         try {
             compile(sources)
 
@@ -183,9 +184,19 @@ abstract class StubTestCase extends GroovyTestCase {
 
                 println "Verifying the stubs"
             }
+        } catch(Throwable t) {
+            compileError = t
         } finally {
-            use (QDoxCategory) {
-                verifyStubs()
+            try {
+                use (QDoxCategory) {
+                    verifyStubs()
+                }
+            } catch(ex) {
+                if (compileError) {
+                    println "Unable to verify stubs: $ex.message\nPerhaps due to earlier
error?"
+                    throw compileError
+                }
+                throw ex
             }
             if (sourceRootPath.getAbsolutePath() =~ 'stubgentests') {
                 sourceRootPath.deleteDir()


Mime
View raw message