Verified Commit 0f0e726d authored by Mark Malone's avatar Mark Malone
Browse files

readme cleanups, coverage regex fix, dotnet tool config added

parent 372dd23c
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-reportgenerator-globaltool": {
"version": "4.8.12",
"commands": [
"reportgenerator"
]
}
}
}
\ No newline at end of file
......@@ -16,6 +16,9 @@
# Mono auto generated files
mono_crash.*
# Coverage report
Reports_Coverage/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
......@@ -60,8 +63,8 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
# Tye
.tye/
# StyleCop
......@@ -304,8 +307,8 @@ paket-files/
# FAKE - F# Make
.fake/
# Ionide - VsCode extension for F# Support
# Ionide - VsCode extension for F# Support
.ionide/
# CodeRush personal settings
......
......@@ -2,7 +2,7 @@ image: microsoft/dotnet:latest
before_script:
- 'echo | dotnet --version'
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
- dotnet tool restore
stages:
- test
......@@ -13,10 +13,8 @@ build:
- dotnet test --collect:"XPlat Code Coverage"
- ls -ld */TestResults/*
- ls -ld ${CI_PROJECT_DIR}/*/TestResults/*/*
# each reporttype must be a separate line, doesn't work together ; separated
- ./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
- ./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:Html;
- dotnet reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
- ls Reports_Coverage
- cat ./Reports_Coverage/Summary.txt
- echo 'End Summary'
coverage: /Summary\n[\s\S]*/
coverage: /Line coverage: *\s+([\d\.]+)%/
......@@ -4,13 +4,12 @@ using HelloWorld;
namespace HelloWorld.Tests
{
public class UnitTest1
public class HelloWorldTests
{
[Fact]
public void Test1()
{
Console.WriteLine(HelloWorld.Program.HelloWorld());
Assert.Equal(HelloWorld.Program.HelloWorld(), "Hello World!");
Assert.Equal("Hello World!", HelloWorld.Program.HelloWorld());
}
}
}
......@@ -5,33 +5,11 @@ HelloWorld is a dotnet 5.0 project to return "Hello world".
## Installation
Use the package manager [dotnet](https://dotnet.microsoft.com/) to install HelloWorld.
Use [dotnet](https://dotnet.microsoft.com/) to build and run HelloWorld.
## Usage
### Building the program
```bash
dotnet build
```
```bash
Microsoft (R) Build Engine version 16.9.0+5e4b48a27 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
HelloWorld -> .../helloworld/HelloWorld/bin/Debug/net5.0/HelloWorld.dll
HelloWorld.Tests -> .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.25
```
### Running the program
......@@ -62,6 +40,30 @@ Hello World!
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 11 ms - .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll (net5.0)
```
### Building the program
```bash
dotnet build
```
```bash
Microsoft (R) Build Engine version 16.9.0+5e4b48a27 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date for restore.
HelloWorld -> .../helloworld/HelloWorld/bin/Debug/net5.0/HelloWorld.dll
HelloWorld.Tests -> .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:02.25
```
## Contributing
See [CONTRIBUTING.md](https://code.80px.com/80px/80px.com/dotnet/helloworld/-/blob/master/CONTRIBUTING.md)
......
image: mcr.microsoft.com/dotnet/sdk:5.0
before_script:
- 'echo | dotnet --version'
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
stages:
- test
build:
stage: test
script:
- dotnet test --collect:"XPlat Code Coverage"
- ls -ld */TestResults/*
- ls -ld ${CI_PROJECT_DIR}/*/TestResults/*/*
# each reporttype must be a separate line, doesn't work together ; separated
- ./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
- ./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:Html;
- ls Reports_Coverage
- cat ./Reports_Coverage/Summary.txt
- echo 'End Summary'
coverage: /Summary\n[\s\S]*/
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment