langtools/test/tools/javac/options/modes/Tester.java
changeset 34560 b6a567b677f7
parent 26264 a09fedde76be
child 36526 3b41f1c69604
--- a/langtools/test/tools/javac/options/modes/Tester.java	Mon Dec 07 09:18:07 2015 -0800
+++ b/langtools/test/tools/javac/options/modes/Tester.java	Mon Dec 07 14:02:55 2015 -0800
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -136,8 +136,11 @@
         } catch (IllegalArgumentException | IllegalStateException | IOException e) {
             tr.setThrown(e);
         } finally {
-            ((JavacFileManager) context.get(JavaFileManager.class)).close();
-            tr.setLogs(sw.toString(), sysOut.close(), sysErr.close());
+            try {
+                ((JavacFileManager) context.get(JavaFileManager.class)).close();
+                tr.setLogs(sw.toString(), sysOut.close(), sysErr.close());
+            } catch (IOException e) {
+            }
         }
         tr.setContext(context);
         tr.show();
@@ -149,6 +152,7 @@
     class TestResult {
         final List<String> args;
         Throwable thrown;
+        List<Throwable> suppressed = new ArrayList<>();
         Object rc; // Number or Boolean
         Map<Log, String> logs;
         Context context;
@@ -172,6 +176,10 @@
             this.rc = ok ? 0 : 1;
         }
 
+        void setSuppressed(Throwable thrown) {
+            this.suppressed.add(thrown);
+        }
+
         void setThrown(Throwable thrown) {
             this.thrown = thrown;
         }
@@ -199,6 +207,11 @@
                 out.print("thrown:" + thrown);
                 needSep = true;
             }
+            if (!suppressed.isEmpty()) {
+                if (needSep) out.print("; ");
+                out.print("suppressed:" + suppressed);
+                needSep = true;
+            }
             if (needSep)
                 out.println();
             logs.forEach((k, v) -> {