annotate graal/com.oracle.truffle.tck/src/com/oracle/truffle/tck/TruffleVerboseTextListener.java @ 21938:0a6e10379b9b

Keeping only Truffle-related modules in this repository
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Fri, 12 Jun 2015 17:02:36 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
21938
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
1 /*
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
2 * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved.
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
4 *
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation. Oracle designates this
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
8 * particular file as subject to the "Classpath" exception as provided
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
9 * by Oracle in the LICENSE file that accompanied this code.
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
10 *
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
11 * This code is distributed in the hope that it will be useful, but WITHOUT
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
14 * version 2 for more details (a copy is included in the LICENSE file that
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
15 * accompanied this code).
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
16 *
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License version
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
18 * 2 along with this work; if not, write to the Free Software Foundation,
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
20 *
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
22 * or visit www.oracle.com if you need additional information or have any
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
23 * questions.
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
24 */
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
25 package com.oracle.truffle.tck;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
26
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
27 import java.io.*;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
28
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
29 import org.junit.internal.*;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
30 import org.junit.runner.*;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
31 import org.junit.runner.notification.*;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
32
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
33 class TruffleVerboseTextListener extends TruffleTextListener {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
34
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
35 public TruffleVerboseTextListener(JUnitSystem system) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
36 this(system.out());
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
37 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
38
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
39 public TruffleVerboseTextListener(PrintStream writer) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
40 super(writer);
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
41 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
42
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
43 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
44 public void testClassStarted(Class<?> clazz) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
45 getWriter().print(clazz.getName() + " started");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
46 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
47
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
48 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
49 public void testClassFinished(Class<?> clazz) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
50 getWriter().print(clazz.getName() + " finished");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
51 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
52
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
53 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
54 public void testStarted(Description description) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
55 getWriter().print(" " + description.getMethodName() + ": ");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
56 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
57
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
58 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
59 public void testIgnored(Description description) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
60 getWriter().print("Ignored");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
61 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
62
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
63 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
64 public void testSucceeded(Description description) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
65 getWriter().print("Passed");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
66 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
67
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
68 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
69 public void testAssumptionFailure(Failure failure) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
70 getWriter().printf("(%s) ", failure.getMessage());
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
71 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
72
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
73 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
74 public void testFailed(Failure failure) {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
75 getWriter().print("FAILED");
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
76 lastFailure = failure;
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
77 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
78
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
79 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
80 public void testClassFinishedDelimiter() {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
81 getWriter().println();
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
82 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
83
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
84 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
85 public void testClassStartedDelimiter() {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
86 getWriter().println();
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
87 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
88
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
89 @Override
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
90 public void testFinishedDelimiter() {
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
91 getWriter().println();
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
92 }
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
93
0a6e10379b9b Keeping only Truffle-related modules in this repository
Jaroslav Tulach <jaroslav.tulach@oracle.com>
parents:
diff changeset
94 }