Mercurial > hg > truffle
annotate graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalVerboseTextListener.java @ 18408:2c3666f44855
Truffle: initial commit of object API implementation
author | Andreas Woess <andreas.woess@jku.at> |
---|---|
date | Tue, 18 Nov 2014 23:19:43 +0100 |
parents | 840257b6cdc5 |
children |
rev | line source |
---|---|
15501 | 1 /* |
2 * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. | |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 * | |
5 * This code is free software; you can redistribute it and/or modify it | |
6 * under the terms of the GNU General Public License version 2 only, as | |
7 * published by the Free Software Foundation. | |
8 * | |
9 * This code is distributed in the hope that it will be useful, but WITHOUT | |
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
12 * version 2 for more details (a copy is included in the LICENSE file that | |
13 * accompanied this code). | |
14 * | |
15 * You should have received a copy of the GNU General Public License version | |
16 * 2 along with this work; if not, write to the Free Software Foundation, | |
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
18 * | |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
20 * or visit www.oracle.com if you need additional information or have any | |
21 * questions. | |
22 */ | |
23 package com.oracle.graal.test; | |
24 | |
25 import java.io.*; | |
26 | |
27 import org.junit.internal.*; | |
28 import org.junit.runner.*; | |
29 import org.junit.runner.notification.*; | |
30 | |
31 public class GraalVerboseTextListener extends GraalTextListener { | |
32 | |
33 public GraalVerboseTextListener(JUnitSystem system) { | |
34 this(system.out()); | |
35 } | |
36 | |
37 public GraalVerboseTextListener(PrintStream writer) { | |
38 super(writer); | |
39 } | |
40 | |
41 @Override | |
42 public void testClassStarted(Class<?> clazz) { | |
43 getWriter().print(clazz.getName() + " started"); | |
44 } | |
45 | |
46 @Override | |
47 public void testClassFinished(Class<?> clazz) { | |
48 getWriter().print(clazz.getName() + " finished"); | |
49 } | |
50 | |
51 @Override | |
52 public void testStarted(Description description) { | |
53 getWriter().print(" " + description.getMethodName() + ": "); | |
54 } | |
55 | |
56 @Override | |
57 public void testIgnored(Description description) { | |
58 getWriter().print("Ignored"); | |
59 } | |
60 | |
61 @Override | |
62 public void testSucceeded(Description description) { | |
63 getWriter().print("Passed"); | |
64 } | |
65 | |
66 @Override | |
18185
a88d819ba6a1
Print information about failed assumptions when running unittests in --verbose mode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15658
diff
changeset
|
67 public void testAssumptionFailure(Failure failure) { |
a88d819ba6a1
Print information about failed assumptions when running unittests in --verbose mode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15658
diff
changeset
|
68 getWriter().printf("(%s) ", failure.getMessage()); |
a88d819ba6a1
Print information about failed assumptions when running unittests in --verbose mode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15658
diff
changeset
|
69 } |
a88d819ba6a1
Print information about failed assumptions when running unittests in --verbose mode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15658
diff
changeset
|
70 |
a88d819ba6a1
Print information about failed assumptions when running unittests in --verbose mode.
Roland Schatz <roland.schatz@oracle.com>
parents:
15658
diff
changeset
|
71 @Override |
15501 | 72 public void testFailed(Failure failure) { |
15658
304e1c30adaf
GraalVerboseTextListener: fix testFailed printing.
Josef Eisl <josef.eisl@jku.at>
parents:
15656
diff
changeset
|
73 getWriter().print("FAILED"); |
18326
840257b6cdc5
mx: added --fail-fast option to unittest that stops Junit after first input class causing a test failure
Doug Simon <doug.simon@oracle.com>
parents:
18185
diff
changeset
|
74 lastFailure = failure; |
15501 | 75 } |
76 | |
77 @Override | |
78 public void testClassFinishedDelimiter() { | |
79 getWriter().println(); | |
80 } | |
81 | |
82 @Override | |
83 public void testClassStartedDelimiter() { | |
84 getWriter().println(); | |
85 } | |
86 | |
87 @Override | |
88 public void testFinishedDelimiter() { | |
89 getWriter().println(); | |
90 } | |
91 | |
92 } |