Skip to content

Commit

Permalink
Update to NET 8 SDK (#422)
Browse files Browse the repository at this point in the history
  • Loading branch information
lahma authored Nov 22, 2023
1 parent 959acf7 commit 9b2487b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0 -- --update-allow-list

- name: Test
run: dotnet test --configuration Release --logger GitHubActions
Expand All @@ -39,7 +39,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release -- --update-allow-list
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0 -- --update-allow-list

- name: Test
run: dotnet test --configuration Release --framework net6.0 --logger GitHubActions
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0

- name: Test
run: dotnet test --configuration Release --framework net6.0 --logger GitHubActions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- name: Generate test cases
working-directory: ./test/Esprima.Tests.Test262
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release
run: dotnet tool restore && dotnet test262 generate && dotnet run -c Release --framework net6.0

- name: Test
run: dotnet test --configuration Release --logger GitHubActions
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.100",
"rollForward": "latestMinor"
}
}
2 changes: 1 addition & 1 deletion test/Esprima.Tests.SourceGenerators/SourceGeneratorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ protected static string LoadEsprimaSourceFile(string file)

protected static string ToEsprimaSourcePath(string path)
{
return Path.Combine("../../../../../src/Esprima/", path);
return Path.Combine("../../../../src/Esprima/", path);
}
}
4 changes: 2 additions & 2 deletions test/Esprima.Tests.Test262/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public static class Program
public static async Task<int> Main(string[] args)
{
var rootDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly()?.Location) ?? string.Empty;
var projectRoot = Path.Combine(rootDirectory, "../../..");
var solutionRoot = Path.Combine(rootDirectory, "../../../..");

var allowListFile = Path.Combine(projectRoot, "allow-list.txt");
var allowListFile = new FileInfo(Path.Combine(solutionRoot, "test", "Esprima.Tests.Test262", "allow-list.txt")).FullName;
var lines = File.Exists(allowListFile) ? await File.ReadAllLinesAsync(allowListFile) : Array.Empty<string>();
var knownFailing = new HashSet<string>(lines
.Where(x => !string.IsNullOrWhiteSpace(x) && !x.StartsWith("#", StringComparison.Ordinal))
Expand Down
4 changes: 2 additions & 2 deletions test/Esprima.Tests/Fixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ internal static string GetFixturesPath()
var assemblyPath = typeof(Fixtures).GetTypeInfo().Assembly.Location;
var assemblyDirectory = new FileInfo(assemblyPath).Directory;
#endif
var root = assemblyDirectory?.Parent?.Parent?.Parent?.FullName;
return root ?? "";
var root = assemblyDirectory?.Parent?.Parent?.Parent?.Parent?.FullName;
return Path.Combine(root ?? "", "test", "Esprima.Tests");
}

private sealed class FixtureMetadata
Expand Down

0 comments on commit 9b2487b

Please sign in to comment.