Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
80px
80px.com
dotnet
HelloWorld
Commits
147c18dd
Verified
Commit
147c18dd
authored
Jul 25, 2021
by
Mark Malone
Browse files
adding test script and improving readme
parent
0f0e726d
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
147c18dd
...
...
@@ -7,8 +7,9 @@ HelloWorld is a dotnet 5.0 project to return "Hello world".
Use
[
dotnet
](
https://dotnet.microsoft.com/
)
to build and run HelloWorld.
## Usage
`dotnet tool restore`
will restore the local code coverage report tool and allow you to run
`./test.sh`
below.
## Usage
### Running the program
...
...
@@ -23,7 +24,8 @@ Hello world!
### Testing the program
```
bash
dotnet
test
chmod
+x test.sh
# Make the test script runnable
./test.sh
```
```
bash
Determining projects to restore...
...
...
@@ -36,9 +38,30 @@ Copyright (c) Microsoft Corporation. All rights reserved.
Starting
test
execution, please wait...
A total of 1
test
files matched the specified pattern.
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
)
Attachments:
.../helloworld/HelloWorld.Tests/TestResults/781ade8b-4be2-479a-8b2d-e180b7a24b36/coverage.cobertura.xml
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 10 ms - .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
(
net5.0
)
2021-07-25T09:17:22: Arguments
2021-07-25T09:17:22:
-reports
:./HelloWorld.Tests/TestResults/
*
/coverage.cobertura.xml
2021-07-25T09:17:22:
-targetdir
:Reports_Coverage
2021-07-25T09:17:22:
-reportTypes
:TextSummary
2021-07-25T09:17:23: Writing report file
'Reports_Coverage/Summary.txt'
2021-07-25T09:17:23: Report generation took 0.2 seconds
Summary
Generated on: 7/25/2021 - 9:17:23 AM
Parser: MultiReportParser
(
3x CoberturaParser
)
Assemblies: 1
Classes: 1
Files: 1
Line coverage: 50.0%
Covered lines: 3
Uncovered lines: 3
Coverable lines: 6
Total lines: 15
HelloWorld 50.0%
HelloWorld.Program 50.0%
```
...
...
test.sh
0 → 100644
View file @
147c18dd
dotnet
test
--collect
:
"XPlat Code Coverage"
dotnet reportgenerator
"-reports:./HelloWorld.Tests/TestResults/*/coverage.cobertura.xml"
"-targetdir:Reports_Coverage"
-reportTypes
:TextSummary
;
cat
./Reports_Coverage/Summary.txt
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment