[test_runner] Rename host-checked to host-asserts

Cleanup this old naming scheme before adding new configs for DDC
that run with assertions enabled in the host compiler.

Change-Id: Icbdee694fac46b3a1d5bab7ee7411c8e9be8c4a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/335385
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
This commit is contained in:
Nicholas Shahan 2024-02-08 22:01:09 +00:00 committed by Commit Queue
parent 070485c19d
commit 0dbeb2135e
11 changed files with 47 additions and 54 deletions

View file

@ -331,7 +331,7 @@ crypto/test/sha256_test: Slow, Pass
[ $compiler == dart2js && $checked ]
crypto/test/base64_test: Slow, Pass
[ $compiler == dart2js && $host_checked ]
[ $compiler == dart2js && $host_asserts ]
js_ast/test/printer_callback_test: Slow, Pass
js_ast/test/string_escape_test: Slow, Pass

View file

@ -281,7 +281,7 @@ class Configuration {
enableAsserts: boolOption("enable-asserts"),
isChecked: boolOption("checked"),
isCsp: boolOption("csp"),
isHostChecked: boolOption("host-checked"),
enableHostAsserts: boolOption("host-asserts"),
isMinified: boolOption("minified"),
useAnalyzerCfe: boolOption("use-cfe"),
useAnalyzerFastaParser: boolOption("analyzer-use-fasta-parser"),
@ -350,8 +350,8 @@ class Configuration {
final bool isCsp;
/// Enables asserts in the dart2js compiler.
final bool isHostChecked;
/// Enables asserts in the backend compilers.
final bool enableHostAsserts;
final bool isMinified;
@ -384,7 +384,7 @@ class Configuration {
bool? enableAsserts,
bool? isChecked,
bool? isCsp,
bool? isHostChecked,
bool? enableHostAsserts,
bool? isMinified,
bool? useAnalyzerCfe,
bool? useAnalyzerFastaParser,
@ -407,7 +407,7 @@ class Configuration {
enableAsserts = enableAsserts ?? false,
isChecked = isChecked ?? false,
isCsp = isCsp ?? false,
isHostChecked = isHostChecked ?? false,
enableHostAsserts = enableHostAsserts ?? false,
isMinified = isMinified ?? false,
useAnalyzerCfe = useAnalyzerCfe ?? false,
useAnalyzerFastaParser = useAnalyzerFastaParser ?? false,
@ -447,7 +447,7 @@ class Configuration {
required this.enableAsserts,
required this.isChecked,
required this.isCsp,
required this.isHostChecked,
required this.enableHostAsserts,
required this.isMinified,
required this.useAnalyzerCfe,
required this.useAnalyzerFastaParser,
@ -485,7 +485,7 @@ class Configuration {
enableAsserts: source.enableAsserts,
isChecked: source.isChecked,
isCsp: source.isCsp,
isHostChecked: source.isHostChecked,
enableHostAsserts: source.enableHostAsserts,
isMinified: source.isMinified,
useAnalyzerCfe: source.useAnalyzerCfe,
useAnalyzerFastaParser: source.useAnalyzerFastaParser,
@ -522,7 +522,7 @@ class Configuration {
enableAsserts == other.enableAsserts &&
isChecked == other.isChecked &&
isCsp == other.isCsp &&
isHostChecked == other.isHostChecked &&
enableHostAsserts == other.enableHostAsserts &&
isMinified == other.isMinified &&
useAnalyzerCfe == other.useAnalyzerCfe &&
useAnalyzerFastaParser == other.useAnalyzerFastaParser &&
@ -575,7 +575,7 @@ class Configuration {
enableAsserts,
isChecked,
isCsp,
isHostChecked,
enableHostAsserts,
isMinified,
useAnalyzerCfe,
useAnalyzerFastaParser,
@ -618,7 +618,7 @@ class Configuration {
if (enableAsserts) fields.add("enable-asserts");
if (isChecked) fields.add("checked");
if (isCsp) fields.add("csp");
if (isHostChecked) fields.add("host-checked");
if (enableHostAsserts) fields.add("host-asserts");
if (isMinified) fields.add("minified");
if (useAnalyzerCfe) fields.add("use-cfe");
if (useAnalyzerFastaParser) fields.add("analyzer-use-fasta-parser");
@ -677,12 +677,11 @@ class Configuration {
boolField("enable-asserts", enableAsserts, other.enableAsserts);
boolField("checked", isChecked, other.isChecked);
boolField("csp", isCsp, other.isCsp);
boolField("host-checked", isHostChecked, other.isHostChecked);
boolField("host-asserts", enableHostAsserts, other.enableHostAsserts);
boolField("minified", isMinified, other.isMinified);
boolField("use-cfe", useAnalyzerCfe, other.useAnalyzerCfe);
boolField("analyzer-use-fasta-parser", useAnalyzerFastaParser,
other.useAnalyzerFastaParser);
boolField("host-checked", isHostChecked, other.isHostChecked);
boolField("hot-reload", useHotReload, other.useHotReload);
boolField("hot-reload-rollback", useHotReloadRollback,
other.useHotReloadRollback);

View file

@ -207,7 +207,7 @@ void main() {
"enable-asserts": true,
"checked": true,
"csp": true,
"host-checked": true,
"host-asserts": true,
"minified": true,
"hot-reload": true,
"hot-reload-rollback": true,
@ -223,7 +223,7 @@ void main() {
enableAsserts: true,
isChecked: true,
isCsp: true,
isHostChecked: true,
enableHostAsserts: true,
isMinified: true,
useHotReload: true,
useHotReloadRollback: true,
@ -379,7 +379,7 @@ void main() {
enableAsserts: true,
isChecked: true,
isCsp: true,
isHostChecked: true,
enableHostAsserts: true,
isMinified: true,
useAnalyzerCfe: true,
useAnalyzerFastaParser: true,
@ -409,11 +409,10 @@ architecture: ia32 x64
enable-asserts: false true
checked: false true
csp: false true
host-checked: false true
host-asserts: false true
minified: false true
use-cfe: false true
analyzer-use-fasta-parser: false true
host-checked: false true
hot-reload: false true
hot-reload-rollback: false true
use-sdk: false true

View file

@ -6194,5 +6194,5 @@ LayoutTests/fast/dom/serialize-attribute_t01: RuntimeError # Please triage this
[ $compiler == dart2js && $runtime == ie11 && $builder_tag == win7]
LayoutTests/fast/files/file-reader-result-twice_t01: Pass, RuntimeError # Issue 31430
[ $compiler == dart2js && $host_checked ]
[ $compiler == dart2js && $host_asserts ]
Language/Types/Function_Types/call_t01: Crash # Issue 28894

View file

@ -65,7 +65,7 @@ abstract class CompilerConfiguration {
bool get _isDebug => _configuration.mode.isDebug;
bool get _isHostChecked => _configuration.isHostChecked;
bool get _enableHostAsserts => _configuration.enableHostAsserts;
bool get _useSdk => _configuration.useSdk;
@ -391,12 +391,12 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
@override
String computeCompilerPath() {
if (_isHostChecked && _useSdk) {
if (_enableHostAsserts && _useSdk) {
// When [_useSdk] is true, dart2js is compiled into a snapshot that was
// built without checked mode. The VM cannot make such snapshot run in
// checked mode later. These two flags could be used together if we also
// build an sdk with checked snapshots.
throw "--host-checked and --use-sdk cannot be used together";
// built without assertions enabled. The VM cannot make such snapshot run
// with assertions later. These two flags could be used together if we
// also build sdk snapshots with assertions enabled.
throw "--host-asserts and --use-sdk cannot be used together";
}
if (_useSdk) {
@ -408,7 +408,7 @@ class Dart2jsCompilerConfiguration extends CompilerConfiguration {
// mode or not.
return '$dartSdk/bin/dart$executableExtension';
} else {
var scriptName = _isHostChecked ? 'dart2js_developer' : 'dart2js';
var scriptName = _enableHostAsserts ? 'dart2js_developer' : 'dart2js';
return 'sdk/bin/$scriptName$shellScriptExtension';
}
}
@ -527,8 +527,8 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
@override
String computeCompilerPath() {
if (_useSdk) {
if (_isHostChecked) {
throw "--host-checked and --use-sdk cannot be used together";
if (_enableHostAsserts) {
throw "--host-asserts and --use-sdk cannot be used together";
}
return '${_configuration.buildDirectory}/dart-sdk/bin/dart';
}
@ -543,7 +543,7 @@ class Dart2WasmCompilerConfiguration extends CompilerConfiguration {
'compile',
'wasm',
] else ...[
if (_isHostChecked) '--compiler-asserts',
if (_enableHostAsserts) '--compiler-asserts',
],
...testFile.sharedOptions,
..._configuration.sharedOptions,
@ -1296,8 +1296,8 @@ class AnalyzerCompilerConfiguration extends CompilerConfiguration {
@override
String computeCompilerPath() {
var prefix = 'sdk/bin';
if (_isHostChecked) {
throw "--host-checked cannot be used for dartanalyzer";
if (_enableHostAsserts) {
throw "--host-asserts cannot be used for dartanalyzer";
}
if (_useSdk) {
prefix = '${_configuration.buildDirectory}/dart-sdk/bin';

View file

@ -119,7 +119,7 @@ class TestConfiguration {
bool get hotReload => configuration.useHotReload;
bool get hotReloadRollback => configuration.useHotReloadRollback;
bool get isChecked => configuration.isChecked;
bool get isHostChecked => configuration.isHostChecked;
bool get enableHostAsserts => configuration.enableHostAsserts;
bool get isCsp => configuration.isCsp;
bool get isMinified => configuration.isMinified;
bool get isSimulator => architecture.isSimulator;

View file

@ -9,8 +9,6 @@ import 'configuration.dart';
typedef _LookUpFunction = String Function(TestConfiguration configuration);
typedef _BoolLookUpFunction = bool Function(TestConfiguration configuration);
// TODO(29756): Instead of synthesized negated variables like "unchecked",
// consider adding support for "!" to status expressions.
final _variables = {
"analyzer": _Variable.bool((c) => c.compiler == Compiler.dart2analyzer),
"analyzer_use_fasta_parser": _Variable.bool((c) => c.useAnalyzerFastaParser),
@ -22,8 +20,7 @@ final _variables = {
"csp": _Variable.bool((c) => c.isCsp),
"enable_asserts": _Variable.bool((c) => c.enableAsserts),
"fasta": _Variable.bool((c) => c.usesFasta),
"host_checked": _Variable.bool((c) => c.isHostChecked),
"host_unchecked": _Variable.bool((c) => !c.isHostChecked),
"host_asserts": _Variable.bool((c) => c.enableHostAsserts),
"hot_reload": _Variable.bool((c) => c.hotReload),
"hot_reload_rollback": _Variable.bool((c) => c.hotReloadRollback),
"ie": _Variable.bool((c) => c.runtime.isIE),

View file

@ -136,12 +136,10 @@ test options, specifying how tests should be run.''')
'flag with without specifying a named configuration.')
..addFlag('build',
help: 'Build the necessary targets to test this configuration')
// TODO(sigmund): rename flag once we migrate all dart2js bots to the test
// matrix.
..addFlag('host-checked',
aliases: ['host_checked'],
..addFlag('host-asserts',
aliases: ['host_asserts'],
hide: true,
help: 'Run compiler with assertions enabled.')
help: 'Run the compiler with assertions enabled.')
..addFlag('minified',
hide: true, help: 'Enable minification in the compiler.')
..addFlag('csp',
@ -153,7 +151,7 @@ test options, specifying how tests should be run.''')
help: 'Only run tests that are not marked `Slow` or `Timeout`.')
..addFlag('enable-asserts',
aliases: ['enable_asserts'],
help: 'Pass the --enable-asserts flag to dart2js or to the vm.')
help: 'Pass the --enable-asserts flag to the compilers or to the vm.')
..addFlag('use-cfe',
aliases: ['use_cfe'],
hide: true,
@ -434,7 +432,7 @@ has been specified on the command line.''')
'use-sdk',
'hot-reload',
'hot-reload-rollback',
'host-checked',
'host-asserts',
'csp',
'minified',
'vm-options',
@ -811,7 +809,7 @@ has been specified on the command line.''')
useSdk: data["use-sdk"] as bool,
useHotReload: data["hot-reload"] as bool,
useHotReloadRollback: data["hot-reload-rollback"] as bool,
isHostChecked: data["host-checked"] as bool,
enableHostAsserts: data["host-asserts"] as bool,
isCsp: data["csp"] as bool,
isMinified: data["minified"] as bool,
vmOptions: vmOptions,

View file

@ -104,7 +104,7 @@ LibTest/html/Window/animationFrame_A01_t01: SkipByDesign # Issue #53985: request
[ $compiler == dart2js && $runtime == d8 ]
LibTest/html/*: SkipByDesign # d8 is not a browser
[ $compiler == dart2js && $runtime == d8 && $host_checked ]
[ $compiler == dart2js && $runtime == d8 && $host_asserts ]
LibTest/collection/ListBase/ListBase_class_A01_t04: Slow, Pass
LibTest/collection/ListBase/ListBase_class_A01_t05: Slow, Pass
LibTest/collection/ListBase/ListBase_class_A01_t06: Slow, Pass

View file

@ -50,7 +50,7 @@ deferred_fail_and_retry_test: SkipByDesign # Uses eval to simulate failed loadin
internal/object_members_test: SkipByDesign # Uses eval for interop
regress/issue/49129_test: SkipByDesign # Uses eval for interop
[ $compiler == dart2js && !$host_checked ]
[ $compiler == dart2js && !$host_asserts ]
deferred/many_parts/many_parts_test: Slow, Pass # Large stress test by design
dummy_compiler_test: Slow, Pass # Issue 32439. self-hosting doesn't work with CFE yet.
@ -60,7 +60,7 @@ code_motion_exception_test: Skip # Requires unminified operator names.
[ $compiler == dart2js && ($runtime == ff || $runtime == jsshell || $runtime == safari) ]
code_motion_exception_test: Skip # Required V8 specific format of JavaScript errors.
[ $compiler == dart2js && ($browser || $host_checked) ]
[ $compiler == dart2js && ($browser || $host_asserts) ]
dummy_compiler_test: SkipByDesign # Issue 30773. Test should be migrated as a unit test of dart2js, is only intended to test self-hosting.
[ $compiler == dartk && $runtime == vm ]

View file

@ -426,20 +426,20 @@
"dart2js-options": [
"--canary"
],
"host-checked": true,
"host-asserts": true,
"timeout": 240
}
},
"dart2js-hostasserts-linux-d8": {
"options": {
"host-checked": true,
"host-asserts": true,
"timeout": 240
}
},
"dart2js-hostasserts-linux-(d8|chrome)-unsound": {
"options": {
"builder-tag": "dart2js-weak",
"host-checked": true,
"host-asserts": true,
"nnbd": "weak",
"timeout": 240
}
@ -450,13 +450,13 @@
"--merge-fragments-threshold=3",
"--simple-load-ids"
],
"host-checked": true,
"host-asserts": true,
"timeout": 240
}
},
"dart2wasm-(linux|mac|win)-(d8|jsshell|jsc|chrome|firefox)": {
"options": {
"host-checked": true,
"host-asserts": true,
"dart2wasm-options": [
"-O0"
],
@ -468,7 +468,7 @@
"dart2wasm-options": [
"-O1"
],
"host-checked": false,
"host-asserts": false,
"timeout": 240
}
},
@ -478,7 +478,7 @@
"-O0",
"--js-compatibility"
],
"host-checked": true,
"host-asserts": true,
"timeout": 240
}
},