| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 package com.google.dart.corelib; | 5 package com.google.dart.corelib; |
| 6 | 6 |
| 7 import com.google.common.io.CharStreams; | 7 import com.google.common.io.CharStreams; |
| 8 import com.google.common.io.LineReader; | 8 import com.google.common.io.LineReader; |
| 9 import com.google.dart.runner.V8Launcher; | |
| 10 | 9 |
| 11 import junit.extensions.TestSetup; | 10 import junit.extensions.TestSetup; |
| 12 import junit.framework.Test; | 11 import junit.framework.Test; |
| 13 import junit.framework.TestCase; | 12 import junit.framework.TestCase; |
| 14 import junit.framework.TestSuite; | 13 import junit.framework.TestSuite; |
| 15 | 14 |
| 16 import java.io.File; | 15 import java.io.File; |
| 17 import java.io.IOException; | 16 import java.io.IOException; |
| 18 import java.io.InputStream; | 17 import java.io.InputStream; |
| 19 import java.io.InputStreamReader; | 18 import java.io.InputStreamReader; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 43 super(test); | 42 super(test); |
| 44 } | 43 } |
| 45 | 44 |
| 46 public static TestSuite suite() { | 45 public static TestSuite suite() { |
| 47 return new SuiteBuilder().buildSuite(); | 46 return new SuiteBuilder().buildSuite(); |
| 48 } | 47 } |
| 49 | 48 |
| 50 protected static class SuiteBuilder { | 49 protected static class SuiteBuilder { |
| 51 protected TestSuite buildSuite() { | 50 protected TestSuite buildSuite() { |
| 52 TestSuite suite = new TestSuite("Shared Dart tests"); | 51 TestSuite suite = new TestSuite("Shared Dart tests"); |
| 53 | |
| 54 if (!V8Launcher.isConfigured()) { | |
| 55 return configurationProblem(suite, | |
| 56 "Please set the system property com.google.d
art.runner.d8"); | |
| 57 } | |
| 58 | |
| 59 File file = new File(listTests[0]); | 52 File file = new File(listTests[0]); |
| 60 if (!file.canExecute()) { | 53 if (!file.canExecute()) { |
| 61 return configurationProblem(suite, file.getPath() + " is not executable"
); | 54 return configurationProblem(suite, file.getPath() + " is not executable"
); |
| 62 } | 55 } |
| 63 ProcessBuilder builder = new ProcessBuilder(listTests); | 56 ProcessBuilder builder = new ProcessBuilder(listTests); |
| 64 try { | 57 try { |
| 65 Process process = builder.start(); | 58 Process process = builder.start(); |
| 66 InputStream inputStream = process.getInputStream(); | 59 InputStream inputStream = process.getInputStream(); |
| 67 StringBuilder sb = new StringBuilder(); | 60 StringBuilder sb = new StringBuilder(); |
| 68 try { | 61 try { |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 suite.addTest(new TestCase("Configuration problem") { | 98 suite.addTest(new TestCase("Configuration problem") { |
| 106 @Override | 99 @Override |
| 107 public void runBare() throws Throwable { | 100 public void runBare() throws Throwable { |
| 108 fail(message); | 101 fail(message); |
| 109 } | 102 } |
| 110 }); | 103 }); |
| 111 return suite; | 104 return suite; |
| 112 } | 105 } |
| 113 } | 106 } |
| 114 } | 107 } |
| OLD | NEW |