This is a fixed up version of:
https://codereview.chromium.org/1305183010/ - Reorder the priority of flags in the test harness when passed to the VM: default flags, file flags, command line flags - Ensure to not enable assertions when not being requested. Peter, any reason to not move the flags in to the configuration file? Why don't we actually have all of them in there? (not that I want to move them, I am just currious why we don't add them in there, it seems more logical to me) BUG= R=iposva@google.com, whesse@google.com Committed: https://github.com/dart-lang/sdk/commit/dd7767d95eda87054844e0b24ebd2ce9b04354bb Review URL: https://codereview.chromium.org//1330643003 .
This commit is contained in:
@@ -9091,7 +9091,7 @@ AstNode* Parser::ParseAssertStatement() {
|
||||
ConsumeToken(); // Consume assert keyword.
|
||||
ExpectToken(Token::kLPAREN);
|
||||
const intptr_t condition_pos = TokenPos();
|
||||
if (!I->flags().asserts() && !I->flags().type_checks()) {
|
||||
if (!I->flags().asserts()) {
|
||||
SkipExpr();
|
||||
ExpectToken(Token::kRPAREN);
|
||||
return NULL;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright (c) 2011, 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.
|
||||
// VMOptions=--enable_type_checks
|
||||
// VMOptions=--enable_asserts
|
||||
//
|
||||
// Dart test program testing assert statements.
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
// Copyright (c) 2015, 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.
|
||||
// VMOptions=--no-enable_asserts --enable_type_checks
|
||||
|
||||
// Ensure that enabling of type checks does not automatically enable asserts.
|
||||
|
||||
main() {
|
||||
assert(false);
|
||||
try {
|
||||
int i = "String";
|
||||
throw "FAIL";
|
||||
} on TypeError catch (e) {
|
||||
print("PASS");
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,9 @@ issue14236_test: Pass # Do not remove this line. It serves as a marker for Issue
|
||||
|
||||
javascript_compatibility_errors_test/none: Fail, OK # Not possible to exclude or annotate with '/// none:'
|
||||
|
||||
[ $runtime != vm ]
|
||||
no_assert_test: Fail, OK # This is testing a vm flag.
|
||||
|
||||
[ $runtime == vm ]
|
||||
package/package_isolate_test: Fail # Issue 12474
|
||||
io/observatory_test: Fail
|
||||
|
||||
@@ -155,7 +155,12 @@ class NoneCompilerConfiguration extends CompilerConfiguration {
|
||||
List<String> sharedOptions,
|
||||
List<String> originalArguments,
|
||||
CommandArtifact artifact) {
|
||||
return <String>[]
|
||||
List<String> args = [];
|
||||
if (isChecked) {
|
||||
args.add('--enable_asserts');
|
||||
args.add('--enable_type_checks');
|
||||
}
|
||||
return args
|
||||
..addAll(vmOptions)
|
||||
..addAll(sharedOptions)
|
||||
..addAll(originalArguments);
|
||||
@@ -315,6 +320,10 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
|
||||
CommandBuilder commandBuilder,
|
||||
List arguments,
|
||||
Map<String, String> environmentOverrides) {
|
||||
arguments = new List.from(arguments);
|
||||
if (isChecked) {
|
||||
arguments.add('--enable_type_checks');
|
||||
}
|
||||
return new CommandArtifact(
|
||||
<Command>[
|
||||
commandBuilder.getAnalysisCommand(
|
||||
|
||||
@@ -2225,10 +2225,6 @@ class TestUtils {
|
||||
|
||||
static List<String> standardOptions(Map configuration) {
|
||||
List args = ["--ignore-unrecognized-flags"];
|
||||
if (configuration["checked"]) {
|
||||
args.add('--enable_asserts');
|
||||
args.add("--enable_type_checks");
|
||||
}
|
||||
String compiler = configuration["compiler"];
|
||||
if (compiler == "dart2js") {
|
||||
args = ['--generate-code-with-compile-time-errors', '--test-mode'];
|
||||
|
||||
Reference in New Issue
Block a user