Unify parsing of co19 test options and regular test options.

Keeps comment that many test options should not be used in co19 tests.

Change-Id: Iacdc6a8d240d8fd5d6ac87fc5a16ff38978d2040
Reviewed-on: https://dart-review.googlesource.com/c/88704
Reviewed-by: Alexander Thomas <athom@google.com>
This commit is contained in:
William Hesse 2019-01-09 17:05:41 +00:00
parent 927b0cb9ed
commit cb966bdce7
2 changed files with 44 additions and 54 deletions

View file

@ -56,7 +56,43 @@ LibTest/isolate/ReceivePort/lastWhere_A01_t01: RuntimeError
[ $compiler == fasta ]
Language/Statements/For/syntax_t13: Crash # Assertion error: kernel_shadow_ast.dart: 'receiver == null': is not true.
Language/Statements/For/syntax_t20: Crash # Assertion error: kernel_shadow_ast.dart: 'receiver == null': is not true.
Language/Statements/For/syntax_t20 tatements/For/syntax_t20: Crash # Assertion error: kernel_shadow_ast.dart: 'receiver == null': is not true.
LanguageFeatures/Set-literals/constant_set_literals_A02_t02/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t02/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t02/03: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t02/04: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t03/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t03/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A02_t03/03: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/03: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/04: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/05: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/06: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/07: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/08: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/constant_set_literals_A05_t01/09: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t01/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t01/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t01/04: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t02/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t02/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t02/05: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t02/06: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/exact_types_of_literals_A01_t02/08: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/semantics_A01_t01/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/semantics_A01_t01/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/semantics_A01_t01/09: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/semantics_A01_t01/10: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/semantics_A05_t05/03: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/01: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/02: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/03: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/04: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/05: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/11: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/12: MissingCompileTimeError # Issue 35608
LanguageFeatures/Set-literals/set_literals_A04_t02/13: MissingCompileTimeError # Issue 35608
[ $runtime == vm ]
LibTest/collection/ListBase/ListBase_class_A01_t02: Pass, Slow # Does many calls

View file

@ -566,8 +566,6 @@ class StandardTestSuite extends TestSuite {
Set<String> _testListPossibleFilenames;
RegExp _selectorFilenameRegExp;
static final Uri co19SuiteLocation = Repository.uri.resolve("tests/co19_2/");
StandardTestSuite(TestConfiguration configuration, String suiteName,
Path suiteDirectory, List<String> statusFilePaths,
{bool recursive: false})
@ -1249,8 +1247,6 @@ class StandardTestSuite extends TestSuite {
Map<String, dynamic> readOptionsFromFile(Uri uri) {
if (uri.path.endsWith('.dill')) {
return optionsFromKernelFile();
} else if ("$uri".startsWith("$co19SuiteLocation")) {
return readOptionsFromCo19File(uri);
}
RegExp testOptionsRegExp = new RegExp(r"// VMOptions=(.*)");
RegExp environmentRegExp = new RegExp(r"// Environment=(.*)");
@ -1394,9 +1390,11 @@ class StandardTestSuite extends TestSuite {
//
// Redo this code once we have a more precise test framework for detecting
// and locating these errors.
var hasSyntaxError = contents.contains("/*@syntax-error=");
var hasCompileError =
hasSyntaxError || contents.contains("/*@compile-error=");
final hasSyntaxError = contents.contains("@syntax-error");
final hasCompileError =
hasSyntaxError || contents.contains("@compile-error");
final hasRuntimeError = contents.contains("@runtime-error");
final hasStaticWarning = contents.contains("@static-warning");
return {
"vmOptions": result,
@ -1409,8 +1407,8 @@ class StandardTestSuite extends TestSuite {
"packages": packages,
"hasSyntaxError": hasSyntaxError,
"hasCompileError": hasCompileError,
"hasRuntimeError": false,
"hasStaticWarning": false,
"hasRuntimeError": hasRuntimeError,
"hasStaticWarning": hasStaticWarning,
"otherScripts": otherScripts,
"otherResources": otherResources,
"isMultitest": isMultitest,
@ -1460,50 +1458,6 @@ class StandardTestSuite extends TestSuite {
if (!needsVmOptions) return [[]];
return optionsFromFile['vmOptions'] as List<List<String>>;
}
/**
* Read options from a co19 test file.
*
* The reason this is different from [readOptionsFromFile] is that
* co19 is developed based on a contract which defines certain test
* tags. These tags may appear unused, but should not be removed
* without consulting with the co19 team.
*
* Also, [readOptionsFromFile] recognizes a number of additional
* tags that are not appropriate for use in general tests of
* conformance to the Dart language. Any Dart implementation must
* pass the co19 test suite as is, and not require extra flags,
* environment variables, configuration files, etc.
*/
Map<String, dynamic> readOptionsFromCo19File(Uri uri) {
String contents = decodeUtf8(new File.fromUri(uri).readAsBytesSync());
bool hasSyntaxError = contents.contains("@syntax-error");
bool hasCompileError =
hasSyntaxError || contents.contains("@compile-error");
bool hasRuntimeError = contents.contains("@runtime-error");
bool hasStaticWarning = contents.contains("@static-warning");
bool isMultitest = multiTestRegExp.hasMatch(contents);
return {
"vmOptions": <List<String>>[[]],
"sharedOptions": <String>[],
"dart2jsOptions": <String>[],
"dartOptions": null,
"packageRoot": null,
"hasSyntaxError": hasSyntaxError,
"hasCompileError": hasCompileError,
"hasRuntimeError": hasRuntimeError,
"hasStaticWarning": hasStaticWarning,
"otherScripts": <String>[],
"otherResources": <String>[],
"isMultitest": isMultitest,
"isMultiHtmlTest": false,
"subtestNames": <String>[],
"isolateStubs": '',
"containsDomImport": false,
};
}
}
/// Used for testing packages in one-off settings, i.e., we pass in the actual