Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(550)

Side by Side Diff: compiler/javatests/com/google/dart/corelib/SharedTestCase.java

Issue 8817020: Fixes for JUnit tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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.dart.compiler.CommandLineOptions.CompilerOptions; 7 import com.google.dart.compiler.CommandLineOptions.CompilerOptions;
8 import com.google.dart.compiler.ast.DartUnit; 8 import com.google.dart.compiler.ast.DartUnit;
9 import com.google.dart.compiler.CompilerConfiguration; 9 import com.google.dart.compiler.CompilerConfiguration;
10 import com.google.dart.compiler.DartArtifactProvider; 10 import com.google.dart.compiler.DartArtifactProvider;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 import java.util.concurrent.atomic.AtomicInteger; 50 import java.util.concurrent.atomic.AtomicInteger;
51 import java.util.regex.Pattern; 51 import java.util.regex.Pattern;
52 52
53 /** 53 /**
54 * Wrapper around test that are shared between compiler and runtime (test.py). 54 * Wrapper around test that are shared between compiler and runtime (test.py).
55 * <p> 55 * <p>
56 * Sometimes, when fixing a known issue, a test that was previously crashing or failing may start 56 * Sometimes, when fixing a known issue, a test that was previously crashing or failing may start
57 * passing. This will show up as a test failure because the status file has wron g information. 57 * passing. This will show up as a test failure because the status file has wron g information.
58 * Please update the status file. 58 * Please update the status file.
59 */ 59 */
60 public class SharedTestCase extends TestCase { 60 public abstract class SharedTestCase extends TestCase {
61 private static final Pattern SEPARATOR = Pattern.compile("\\t"); 61 private static final Pattern SEPARATOR = Pattern.compile("\\t");
62 62
63 private final Set<String> outcomes; 63 private final Set<String> outcomes;
64 private final boolean isNegative; 64 private final boolean isNegative;
65 private final String[] arguments; 65 private final String[] arguments;
66 private final boolean regularCompile; 66 private final boolean regularCompile;
67 private final AtomicInteger compilationErrorCount = new AtomicInteger(0); 67 private final AtomicInteger compilationErrorCount = new AtomicInteger(0);
68 private final AtomicInteger typeErrorCount = new AtomicInteger(0); 68 private final AtomicInteger typeErrorCount = new AtomicInteger(0);
69 private final AtomicInteger warningCount = new AtomicInteger(0); 69 private final AtomicInteger warningCount = new AtomicInteger(0);
70 70
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 } 283 }
284 284
285 static Test getInstance(String line, boolean regularCompile) { 285 static Test getInstance(String line, boolean regularCompile) {
286 String[] fields = SEPARATOR.split(line); 286 String[] fields = SEPARATOR.split(line);
287 assertTrue(line, fields.length > 3); 287 assertTrue(line, fields.length > 3);
288 String name = fields[0]; 288 String name = fields[0];
289 Set<String> outcomes = new HashSet<String>(Arrays.<String>asList(fields[1].s plit(","))); 289 Set<String> outcomes = new HashSet<String>(Arrays.<String>asList(fields[1].s plit(",")));
290 boolean isNegative = fields[2].equals("True"); 290 boolean isNegative = fields[2].equals("True");
291 String[] arguments = new String[fields.length - 3]; 291 String[] arguments = new String[fields.length - 3];
292 System.arraycopy(fields, 3, arguments, 0, arguments.length); 292 System.arraycopy(fields, 3, arguments, 0, arguments.length);
293 return new SharedTestCase(name, outcomes, isNegative, regularCompile, argume nts); 293 return new SharedTestCase(name, outcomes, isNegative, regularCompile, argume nts) {};
294 } 294 }
295 } 295 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698