Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ jobs:
- name: Build
run: dotnet build -c ${{ matrix.configuration }} --no-restore
- name: Test
run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --collect:"XPlat Code Coverage" -p:TestTfmsInParallel=true -- /Parallel
# --report-gh is not working
run: dotnet test -c ${{ matrix.configuration }} --no-build --no-restore --verbosity normal --coverage --coverage-output-format cobertura -p:TestTfmsInParallel=true
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./TestResults/*.cobertura.xml
flags: ${{ matrix.os }}
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
with:
files: ./TestResults/*.cobertura.xml
flags: ${{ matrix.configuration }}
token: ${{ secrets.CODECOV_TOKEN }}

Expand Down Expand Up @@ -152,7 +155,8 @@ jobs:
- name: Setup .NET (8.0.x, global.json)
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: 8.0.x
dotnet-version: |
8.0.x
global-json-file: global.json
# No need to define min ver version globally now since only uploading release
# when version and tag is defined.
Expand Down
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"version": "10.0.400",
"rollForward": "latestPatch",
"allowPrerelease": false
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
13 changes: 4 additions & 9 deletions src/Sep.Test/Sep.Test.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSTest.Sdk/4.3.3">

<PropertyGroup>
<RootNamespace>nietras.SeparatedValues.Test</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CA2007</NoWarn>

<OutputType>Exe</OutputType>
<EnableMSTestRunner>true</EnableMSTestRunner>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,12 +18,4 @@
<AssemblyAttribute Include="System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MSTest" Version="4.3.3" />
</ItemGroup>

</Project>
10 changes: 4 additions & 6 deletions src/Sep.XyzTest/Sep.XyzTest.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSTest.Sdk/4.3.3">

<PropertyGroup>
<RootNamespace>nietras.SeparatedValues.XyzTest</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CA2007</NoWarn>

<OutputType>Exe</OutputType>
<EnableMSTestRunner>true</EnableMSTestRunner>
</PropertyGroup>

<ItemGroup>
Expand All @@ -16,12 +19,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="coverlet.collector" Version="10.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="PublicApiGenerator" Version="11.5.4" />
<PackageReference Include="MSTest" Version="4.3.3" />
<PackageReference Include="CsvHelper" Version="33.1.0" />
<PackageReference Include="Sylvan.Common" Version="0.4.3" />
<PackageReference Include="Sylvan.Data" Version="0.2.17" />
Expand Down
27 changes: 21 additions & 6 deletions test-parsers.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env pwsh
Try {
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true

try {
dotnet build .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-restore
if ($LASTEXITCODE -ne 0) {
throw "Debug build failed with exit code $LASTEXITCODE."
}
dotnet build .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-restore
if ($LASTEXITCODE -ne 0) {
throw "Release build failed with exit code $LASTEXITCODE."
}

$parsers = @(
"SepParserAdvSimdLoad4xNrwCmpOrBulkMoveMaskTzcnt",
Expand All @@ -19,12 +28,18 @@ Try {
)

foreach ($parser in $parsers) {
$env:SEPFORCEPARSER=$parser
$env:SEPFORCEPARSER = $parser
Write-Output "Testing $parser Debug"
dotnet test .\src\Sep.Test\Sep.Test.csproj --nologo -c Debug --no-build --no-restore -p:TestTfmsInParallel=true -- /Parallel
dotnet test --project .\src\Sep.Test\Sep.Test.csproj -c Debug --no-build --no-restore
if ($LASTEXITCODE -ne 0) {
throw "Debug parser test failed for $parser with exit code $LASTEXITCODE."
}
Write-Output "Testing $parser Release"
dotnet test .\src\Sep.Test\Sep.Test.csproj --nologo -c Release --no-build --no-restore -p:TestTfmsInParallel=true -- /Parallel
dotnet test --project .\src\Sep.Test\Sep.Test.csproj -c Release --no-build --no-restore
if ($LASTEXITCODE -ne 0) {
throw "Release parser test failed for $parser with exit code $LASTEXITCODE."
}
}
} Finally {
Remove-Item env:SEPFORCEPARSER
} finally {
Remove-Item env:SEPFORCEPARSER -ErrorAction SilentlyContinue
}
33 changes: 25 additions & 8 deletions test-x64-x86.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
#!/usr/bin/env pwsh
Write-Output "Testing Debug X86"
dotnet test --nologo -c Debug -- RunConfiguration.TargetPlatform=x86 /Parallel
Write-Output "Testing Release X86"
dotnet test --nologo -c Release -- RunConfiguration.TargetPlatform=x86 /Parallel
Write-Output "Testing Debug X64"
dotnet test --nologo -c Debug -- RunConfiguration.TargetPlatform=x64 /Parallel
Write-Output "Testing Release X64"
dotnet test --nologo -c Release --collect:"XPlat Code Coverage" -- RunConfiguration.TargetPlatform=x64 /Parallel
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true

$testProjects = @(
".\src\Sep.Test\Sep.Test.csproj"
".\src\Sep.XyzTest\Sep.XyzTest.csproj"
)
$configurations = @(
"Debug"
"Release"
)
$architectures = @(
"x86"
"x64"
)

foreach ($architecture in $architectures) {
foreach ($configuration in $configurations) {
Write-Output "Testing $configuration $($architecture.ToUpperInvariant())"

foreach ($project in $testProjects) {
dotnet test --project $project -c $configuration --arch $architecture
}
}
}