Mercurial > hg > graal-compiler
comparison graal/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTestRunner.java @ 18485:e3c95cbbb50c
Truffle Instrumentation: major API revision, based around the Probe and Instrument classes; add Instrumentable API for language implementors, with most details automated; reimplemented to handle AST splitting automatically; more JUnit tests.
author | Michael Van De Vanter <michael.van.de.vanter@oracle.com> |
---|---|
date | Sun, 23 Nov 2014 16:07:23 -0800 |
parents | 004e3f0a0517 |
children | 99942eac9c6d |
comparison
equal
deleted
inserted
replaced
18484:e97e1f07a3d6 | 18485:e3c95cbbb50c |
---|---|
38 | 38 |
39 import com.oracle.truffle.api.dsl.*; | 39 import com.oracle.truffle.api.dsl.*; |
40 import com.oracle.truffle.api.source.*; | 40 import com.oracle.truffle.api.source.*; |
41 import com.oracle.truffle.sl.*; | 41 import com.oracle.truffle.sl.*; |
42 import com.oracle.truffle.sl.builtins.*; | 42 import com.oracle.truffle.sl.builtins.*; |
43 import com.oracle.truffle.sl.factory.*; | |
43 import com.oracle.truffle.sl.runtime.*; | 44 import com.oracle.truffle.sl.runtime.*; |
44 import com.oracle.truffle.sl.test.SLTestRunner.TestCase; | 45 import com.oracle.truffle.sl.test.SLTestRunner.TestCase; |
45 | 46 |
46 public final class SLTestRunner extends ParentRunner<TestCase> { | 47 public final class SLTestRunner extends ParentRunner<TestCase> { |
47 | 48 |
164 notifier.fireTestStarted(testCase.name); | 165 notifier.fireTestStarted(testCase.name); |
165 | 166 |
166 ByteArrayOutputStream out = new ByteArrayOutputStream(); | 167 ByteArrayOutputStream out = new ByteArrayOutputStream(); |
167 PrintStream printer = new PrintStream(out); | 168 PrintStream printer = new PrintStream(out); |
168 try { | 169 try { |
169 SLContext context = new SLContext(new BufferedReader(new StringReader(repeat(testCase.testInput, repeats))), printer); | 170 SLContext context = SLContextFactory.create(new BufferedReader(new StringReader(repeat(testCase.testInput, repeats))), printer); |
170 for (NodeFactory<? extends SLBuiltinNode> builtin : builtins) { | 171 for (NodeFactory<? extends SLBuiltinNode> builtin : builtins) { |
171 context.installBuiltin(builtin); | 172 context.installBuiltin(builtin); |
172 } | 173 } |
173 final Source source = Source.fromText(readAllLines(testCase.path), testCase.sourceName); | 174 final Source source = Source.fromText(readAllLines(testCase.path), testCase.sourceName); |
174 SLMain.run(context, source, null, repeats); | 175 SLMain.run(context, source, null, repeats); |