Skip to content

Commit 12c3ba3

Browse files
authored
Update test suite and add excluded features (#355)
1 parent 3be1811 commit 12c3ba3

File tree

3 files changed

+12
-1237
lines changed

3 files changed

+12
-1237
lines changed

test/Esprima.Tests.Test262/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ public static async Task<int> Main(string[] args)
2727
var serializerOptions = new JsonSerializerOptions { ReadCommentHandling = JsonCommentHandling.Skip };
2828
var settings = JsonSerializer.Deserialize<Dictionary<string, object>>(await File.ReadAllTextAsync("Test262Harness.settings.json"), serializerOptions)!;
2929
var sha = settings["SuiteGitSha"].ToString()!;
30+
var excludedFeatures = ((JsonElement) settings["ExcludedFeatures"]).EnumerateArray().Select(x => x.ToString()).ToArray();
3031
var stream = await Test262StreamExtensions.FromGitHub(sha);
3132

33+
if (excludedFeatures.Length > 0)
34+
{
35+
AnsiConsole.MarkupLine("Features excluded: [yellow]{0}[/]", string.Join(", ", excludedFeatures));
36+
}
37+
3238
// we materialize to give better feedback on progress
3339
var test262Files = new ConcurrentBag<Test262File>();
3440

@@ -74,7 +80,7 @@ public static async Task<int> Main(string[] args)
7480
parser.ParseModule(file.Program);
7581
}
7682
},
77-
IsIgnored = file => knownFailing.Contains(file.ToString()),
83+
IsIgnored = file => file.Features.IndexOfAny(excludedFeatures.AsSpan()) != -1 || knownFailing.Contains(file.ToString()),
7884
IsParseError = exception => exception is ParserException,
7985
ShouldThrow = file => file.NegativeTestCase?.Type == ExpectedErrorType.SyntaxError || file.NegativeTestCase?.Phase == TestingPhase.Parse,
8086
OnTestExecuted = _ => testTask.Increment(1)

test/Esprima.Tests.Test262/Test262Harness.settings.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
{
2-
"SuiteGitSha": "8565eea8be06eee720b9af42235d1ecf5df0dc5f",
2+
"SuiteGitSha": "83a46bfe0e79aed8274a1b9f4beb0a2efa0b3533",
33
//"SuiteDirectory": "//mnt/c/work/test262",
44
"TargetPath": "./Generated",
55
"Namespace": "Esprima.Tests.Test262",
66
"Parallel": true,
7-
"ExcludedFeatures": [],
7+
"ExcludedFeatures": [
8+
"regexp-unicode-property-escapes",
9+
"top-level-await"
10+
],
811
"ExcludedFlags": [],
912
"ExcludedDirectories": [],
1013
"ExcludedFiles": [],

0 commit comments

Comments
 (0)