Files
sdk/compiler/java/com/google/dart/compiler/testing/TestCompilerConfiguration.java
T
zundel@google.com 43b2154b54 Fixes warnings and formatting issues in some dartc files
After these changes, I have no more warnings printed in Eclipse.

Review URL: https://chromiumcodereview.appspot.com//10027003

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@6321 260f80e4-7a28-3924-810f-c04153c831b5
2012-04-09 14:05:05 +00:00

95 lines
2.2 KiB
Java

// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
package com.google.dart.compiler.testing;
import com.google.dart.compiler.CommandLineOptions.CompilerOptions;
import com.google.dart.compiler.CompilerConfiguration;
import com.google.dart.compiler.DartCompilationPhase;
import com.google.dart.compiler.LibrarySource;
import com.google.dart.compiler.SystemLibraryManager;
import com.google.dart.compiler.UrlLibrarySource;
import com.google.dart.compiler.metrics.CompilerMetrics;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.Collections;
import java.util.List;
/**
* A mock configuration for use in tests.
*/
public class TestCompilerConfiguration implements CompilerConfiguration {
private final CompilerOptions compilerOptions = new CompilerOptions();
private final SystemLibraryManager systemLibraryManager =
new SystemLibraryManager();
@Override
public boolean developerModeChecks() {
return false;
}
@Override
public boolean warningsAreFatal() {
return false;
}
@Override
public boolean typeErrorsAreFatal() {
return false;
}
@Override
public boolean resolveDespiteParseErrors() {
return true;
}
@Override
public boolean incremental() {
return false;
}
@Override
public List<DartCompilationPhase> getPhases() {
return Collections.emptyList();
}
@Override
public File getOutputDirectory() {
throw new AssertionError();
}
@Override
public CompilerMetrics getCompilerMetrics() {
return null;
}
@Override
public String getJvmMetricOptions() {
return null;
}
@Override
public LibrarySource getSystemLibraryFor(String importSpec) {
URI systemUri;
try {
systemUri = new URI(importSpec);
} catch (URISyntaxException e) {
throw new RuntimeException(e);
}
return new UrlLibrarySource(systemUri, this.systemLibraryManager);
}
@Override
public CompilerOptions getCompilerOptions() {
return compilerOptions;
}
@Override
public ErrorFormat printErrorFormat() {
return ErrorFormat.MACHINE;
}
}