@@ -0,0 +1,58 @@
|
|||||||
|
name: .NET Test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
tags-ignore:
|
||||||
|
- '**'
|
||||||
|
paths-ignore:
|
||||||
|
- 'README.md'
|
||||||
|
- 'LICENSE'
|
||||||
|
- '.vscode/**'
|
||||||
|
- '.gitea/workflows/publish-*.yaml'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: .NET tests
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
actions: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOTNET_CLI_TELEMETRY_OPTOUT: 'true'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Setup .NET
|
||||||
|
uses: actions/setup-dotnet@v4
|
||||||
|
with:
|
||||||
|
global-json-file: global.json
|
||||||
|
|
||||||
|
- name: Restore dependencies
|
||||||
|
run: dotnet restore --disable-parallel
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: dotnet build --configuration Release --no-restore
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: >-
|
||||||
|
dotnet test --configuration Release --no-build --verbosity normal
|
||||||
|
--minimum-expected-tests 1
|
||||||
|
--report-xunit-trx --coverlet --coverlet-output-format cobertura
|
||||||
|
--coverlet-include "[Just.PreciseMath]*"
|
||||||
|
|
||||||
|
- name: Upload test and coverage results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ always() }}
|
||||||
|
with:
|
||||||
|
name: test-results
|
||||||
|
path: |
|
||||||
|
1-tests/**/TestResults/**/*.trx
|
||||||
|
1-tests/**/TestResults/**/*cobertura*.xml
|
||||||
|
retention-days: 3
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using Shouldly;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Just.PreciseMath.Tests;
|
||||||
|
|
||||||
|
public class DoubleDoubleTests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void OneHasExpectedComponents()
|
||||||
|
{
|
||||||
|
DoubleDouble value = DoubleDouble.One;
|
||||||
|
|
||||||
|
value.High.ShouldBe(1.0);
|
||||||
|
value.Low.ShouldBe(0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
# Just.PreciseMath
|
# Just.PreciseMath
|
||||||
|
|
||||||
**WIP — repository scaffolding only; no library implementation or tests yet.**
|
**WIP — initial library implementation and one smoke test; numerical correctness is not yet validated.**
|
||||||
|
|
||||||
A .NET 10 library being developed for extended-precision floating-point arithmetic
|
A .NET 10 library being developed for extended-precision floating-point arithmetic
|
||||||
using double-double representations (a high/low pair of `double` values), with
|
using double-double representations (a high/low pair of `double` values), with
|
||||||
@@ -42,11 +42,27 @@ dotnet test --solution Just.PreciseMath.slnx -c Release --no-build
|
|||||||
dotnet format Just.PreciseMath.slnx --verify-no-changes --no-restore
|
dotnet format Just.PreciseMath.slnx --verify-no-changes --no-restore
|
||||||
```
|
```
|
||||||
|
|
||||||
The empty test project currently reports no tests (MTP exit code 8); this is not a
|
The initial smoke test checks that `DoubleDouble.One` exposes high and low
|
||||||
passing test suite. Once tests exist, add `--coverlet` to the test command for
|
components of `1.0` and `0.0`. It exercises the test/coverage pipeline, not the
|
||||||
coverage. The benchmark project deliberately builds as a library without source
|
numerical accuracy of the planned library.
|
||||||
files; add an entry point and benchmark cases, then change `OutputType` to `Exe`
|
|
||||||
and run it in Release without a debugger. No performance results exist yet.
|
CI collects TRX test results and Cobertura coverage for `Just.PreciseMath` only,
|
||||||
|
excluding test dependencies, and requires at least one test. The `test-results`
|
||||||
|
artifact contains TRX test results and timestamped Cobertura XML coverage reports,
|
||||||
|
retained for three days.
|
||||||
|
Open the workflow run in Gitea Actions and download that artifact. Upload is
|
||||||
|
attempted even when tests fail; no badges or repository-write token are needed.
|
||||||
|
|
||||||
|
To generate the same reports locally:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
dotnet test --solution Just.PreciseMath.slnx -c Release --no-build --minimum-expected-tests 1 --report-xunit-trx --coverlet --coverlet-output-format cobertura --coverlet-include "[Just.PreciseMath]*"
|
||||||
|
```
|
||||||
|
|
||||||
|
Reports are written under each test project's `bin/Release/net10.0/TestResults/`.
|
||||||
|
The benchmark project deliberately builds as a library without source files;
|
||||||
|
add an entry point and benchmark cases, then change `OutputType` to `Exe` and run
|
||||||
|
it in Release without a debugger. No performance results exist yet.
|
||||||
|
|
||||||
Package metadata uses the development version `0.1.0-dev`. Licensed under the
|
Package metadata uses the development version `0.1.0-dev`. Licensed under the
|
||||||
[MIT License](LICENSE), included in the package.
|
[MIT License](LICENSE), included in the package.
|
||||||
|
|||||||
Reference in New Issue
Block a user