comparison graal/com.oracle.truffle.sl.test/src/com/oracle/truffle/sl/test/SLTestRunner.java @ 16675:0fc43b066eee

SL/SourceAttribution: correct some omissions, and in particular add new node SLParenExpressionNode to represent a parenthesized expression; this is semantically neutral of course, but needed to account correctly for the text of such an expression (as opposed to its contents).
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Fri, 01 Aug 2014 16:30:22 -0700
parents 915ebb306fcc
children 7c8ddb4233cd
comparison
equal deleted inserted replaced
16674:70f47dbbcabd 16675:0fc43b066eee
41 import com.oracle.truffle.sl.runtime.*; 41 import com.oracle.truffle.sl.runtime.*;
42 import com.oracle.truffle.sl.test.SLTestRunner.TestCase; 42 import com.oracle.truffle.sl.test.SLTestRunner.TestCase;
43 43
44 public final class SLTestRunner extends ParentRunner<TestCase> { 44 public final class SLTestRunner extends ParentRunner<TestCase> {
45 45
46 private static final int REPEATS = 10; 46 private static final int REPEATS = 1;
47 47
48 private static final String SOURCE_SUFFIX = ".sl"; 48 private static final String SOURCE_SUFFIX = ".sl";
49 private static final String INPUT_SUFFIX = ".input"; 49 private static final String INPUT_SUFFIX = ".input";
50 private static final String OUTPUT_SUFFIX = ".output"; 50 private static final String OUTPUT_SUFFIX = ".output";
51 51
154 ByteArrayOutputStream out = new ByteArrayOutputStream(); 154 ByteArrayOutputStream out = new ByteArrayOutputStream();
155 PrintStream printer = new PrintStream(out); 155 PrintStream printer = new PrintStream(out);
156 try { 156 try {
157 SLContext context = new SLContext(new BufferedReader(new StringReader(repeat(testCase.testInput, REPEATS))), printer); 157 SLContext context = new SLContext(new BufferedReader(new StringReader(repeat(testCase.testInput, REPEATS))), printer);
158 final Source source = Source.fromText(readAllLines(testCase.path), testCase.sourceName); 158 final Source source = Source.fromText(readAllLines(testCase.path), testCase.sourceName);
159 SLMain.run(context, source, null, REPEATS); 159 SLMain.run(context, source, System.out, REPEATS);
160 160
161 String actualOutput = new String(out.toByteArray()); 161 String actualOutput = new String(out.toByteArray());
162 Assert.assertEquals(repeat(testCase.expectedOutput, REPEATS), actualOutput); 162 Assert.assertEquals(repeat(testCase.expectedOutput, REPEATS), actualOutput);
163 } catch (Throwable ex) { 163 } catch (Throwable ex) {
164 notifier.fireTestFailure(new Failure(testCase.name, ex)); 164 notifier.fireTestFailure(new Failure(testCase.name, ex));