Skip to content

Commit fb4478c

Browse files
committed
Archive unit tests for MWS and macOS
1 parent 6d6787b commit fb4478c

File tree

3 files changed

+73
-55
lines changed

3 files changed

+73
-55
lines changed

.github/workflows/macos-unit-tests.yml

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ jobs:
55
build:
66
name: unit-tests
77
runs-on: macos-latest
8+
permissions:
9+
contents: read
810
steps:
9-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1012

1113
- name: build & run tests
1214
run: |
@@ -17,10 +19,10 @@ jobs:
1719
cmake ./
1820
make -j4
1921
cd bin
20-
./TETestRunner --reporter JUnit::out=TE-junit.xml
21-
cat TE-junit.xml
22-
errors=$(cat TE-junit.xml | ggrep -Po '(errors)="\K[^"]*')
23-
failures=$(cat TE-junit.xml | ggrep -Po '(failures)="\K[^"]*')
22+
./TETestRunner --reporter JUnit::out=te-junit.xml
23+
cat te-junit.xml
24+
errors=$(cat te-junit.xml | ggrep -Po '(errors)="\K[^"]*')
25+
failures=$(cat te-junit.xml | ggrep -Po '(failures)="\K[^"]*')
2426
echo "Error count is: ${errors}"
2527
echo "Failure count is: ${failures}"
2628
if [ "$errors" -gt 0 ]; then
@@ -36,10 +38,10 @@ jobs:
3638
cmake -DTE_POW_FROM_RIGHT=1 ./
3739
make -j4
3840
cd bin
39-
./TETestRunner --reporter JUnit::out=TE-junit2.xml
40-
cat TE-junit2.xml
41-
errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*')
42-
failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*')
41+
./TETestRunner --reporter JUnit::out=te-junit-pow-from-right.xml
42+
cat te-junit-pow-from-right.xml
43+
errors=$(cat te-junit-pow-from-right.xml | ggrep -Po '(errors)="\K[^"]*')
44+
failures=$(cat te-junit-pow-from-right.xml | ggrep -Po '(failures)="\K[^"]*')
4345
echo "Error count is: ${errors}"
4446
echo "Failure count is: ${failures}"
4547
if [ "$errors" -gt 0 ]; then
@@ -55,10 +57,10 @@ jobs:
5557
cmake -DTE_FLOAT=1 ./
5658
make -j4
5759
cd bin
58-
./TETestRunner --reporter JUnit::out=TE-junit2.xml
59-
cat TE-junit2.xml
60-
errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*')
61-
failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*')
60+
./TETestRunner --reporter JUnit::out=te-junit-float.xml
61+
cat te-junit-float.xml
62+
errors=$(cat te-junit-float.xml | ggrep -Po '(errors)="\K[^"]*')
63+
failures=$(cat te-junit-float.xml | ggrep -Po '(failures)="\K[^"]*')
6264
echo "Error count is: ${errors}"
6365
echo "Failure count is: ${failures}"
6466
if [ "$errors" -gt 0 ]; then
@@ -74,10 +76,10 @@ jobs:
7476
cmake -DTE_LONG_DOUBLE=1 ./
7577
make -j4
7678
cd bin
77-
./TETestRunner --reporter JUnit::out=TE-junit2.xml
78-
cat TE-junit2.xml
79-
errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*')
80-
failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*')
79+
./TETestRunner --reporter JUnit::out=te-junit-long-double.xml
80+
cat te-junit-long-double.xml
81+
errors=$(cat te-junit-long-double.xml | ggrep -Po '(errors)="\K[^"]*')
82+
failures=$(cat te-junit-long-double.xml | ggrep -Po '(failures)="\K[^"]*')
8183
echo "Error count is: ${errors}"
8284
echo "Failure count is: ${failures}"
8385
if [ "$errors" -gt 0 ]; then
@@ -93,10 +95,10 @@ jobs:
9395
cmake -DTE_BITWISE_OPERATORS=1 ./
9496
make -j4
9597
cd bin
96-
./TETestRunner --reporter JUnit::out=TE-junit2.xml
97-
cat TE-junit2.xml
98-
errors=$(cat TE-junit2.xml | ggrep -Po '(errors)="\K[^"]*')
99-
failures=$(cat TE-junit2.xml | ggrep -Po '(failures)="\K[^"]*')
98+
./TETestRunner --reporter JUnit::out=te-junit-bitwise.xml
99+
cat te-junit-bitwise.xml
100+
errors=$(cat te-junit-bitwise.xml | ggrep -Po '(errors)="\K[^"]*')
101+
failures=$(cat te-junit-bitwise.xml | ggrep -Po '(failures)="\K[^"]*')
100102
echo "Error count is: ${errors}"
101103
echo "Failure count is: ${failures}"
102104
if [ "$errors" -gt 0 ]; then
@@ -105,3 +107,9 @@ jobs:
105107
if [ "$failures" -gt 0 ]; then
106108
exit 1
107109
fi
110+
111+
- name: Archive test results
112+
uses: actions/upload-artifact@v4
113+
with:
114+
name: macOS unit tests
115+
path: ${{ github.workspace }}/tests/bin/*.xml

.github/workflows/msw-unit-tests.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Windows Build & Unit Tests
2-
on: [push]
2+
on: [push, pull_request]
33

44
env:
55
testrunner: 'TETestRunner'
@@ -9,8 +9,10 @@ jobs:
99
build:
1010
name: unit-tests
1111
runs-on: windows-latest
12+
permissions:
13+
contents: read
1214
steps:
13-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1416
with:
1517
submodules: 'true'
1618
- run: git config --global core.autocrlf input
@@ -48,9 +50,9 @@ jobs:
4850
cmake -DTE_POW_FROM_RIGHT = 1 ./
4951
msbuild ${{ env.testrunner }}.sln
5052
cd bin\Debug
51-
./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }}
52-
cat ${{ env.outfile }}
53-
$FileContent = Get-Content ${{ env.outfile }}
53+
./${{ env.testrunner }} --reporter JUnit::out=te-junit-pow-from-right.xml
54+
cat te-junit-pow-from-right.xml
55+
$FileContent = Get-Content te-junit-pow-from-right.xml
5456
$errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } )
5557
$failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } )
5658
if ($errors.Value -gt 0)
@@ -70,9 +72,9 @@ jobs:
7072
cmake -DTE_FLOAT = 1 ./
7173
msbuild ${{ env.testrunner }}.sln
7274
cd bin\Debug
73-
./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }}
74-
cat ${{ env.outfile }}
75-
$FileContent = Get-Content ${{ env.outfile }}
75+
./${{ env.testrunner }} --reporter JUnit::out=te-junit-float.xml
76+
cat te-junit-float.xml
77+
$FileContent = Get-Content te-junit-float.xml
7678
$errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } )
7779
$failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } )
7880
if ($errors.Value -gt 0)
@@ -92,9 +94,9 @@ jobs:
9294
cmake -DTE_LONG_DOUBLE = 1 ./
9395
msbuild ${{ env.testrunner }}.sln
9496
cd bin\Debug
95-
./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }}
96-
cat ${{ env.outfile }}
97-
$FileContent = Get-Content ${{ env.outfile }}
97+
./${{ env.testrunner }} --reporter JUnit::out=te-junit-long-double.xml
98+
cat te-junit-long-double.xml
99+
$FileContent = Get-Content te-junit-long-double.xml
98100
$errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } )
99101
$failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } )
100102
if ($errors.Value -gt 0)
@@ -114,9 +116,9 @@ jobs:
114116
cmake -DTE_BITWISE_OPERATORS = 1 ./
115117
msbuild ${{ env.testrunner }}.sln
116118
cd bin\Debug
117-
./${{ env.testrunner }} --reporter JUnit::out=${{ env.outfile }}
118-
cat ${{ env.outfile }}
119-
$FileContent = Get-Content ${{ env.outfile }}
119+
./${{ env.testrunner }} --reporter JUnit::out=te-junit-bitwise.xml
120+
cat te-junit-bitwise.xml
121+
$FileContent = Get-Content te-junit-bitwise.xml
120122
$errors = (Select-String -InputObject $FileContent -Pattern 'errors="([0-9]+)"' | % { $($_.matches.groups[1]) } )
121123
$failures = (Select-String -InputObject $FileContent -Pattern 'failures="([0-9]+)"' | % { $($_.matches.groups[1]) } )
122124
if ($errors.Value -gt 0)
@@ -129,3 +131,9 @@ jobs:
129131
Write-Host "Failure count is: " + $failures.Value
130132
exit 1
131133
}
134+
135+
- name: Archive test results
136+
uses: actions/upload-artifact@v4
137+
with:
138+
name: MSW unit tests
139+
path: ${{ github.workspace }}/tests/bin/Debug/*.xml

.github/workflows/unit-tests.yml

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ jobs:
55
build:
66
name: unit-tests
77
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
810
steps:
911
- uses: actions/checkout@v4
1012

@@ -21,10 +23,10 @@ jobs:
2123
cmake ./
2224
make -j4
2325
cd bin
24-
./TETestRunner --reporter JUnit::out=TE-junit.xml
25-
cat TE-junit.xml
26-
errors=$(cat TE-junit.xml | grep -Po '(errors)="\K[^"]*')
27-
failures=$(cat TE-junit.xml | grep -Po '(failures)="\K[^"]*')
26+
./TETestRunner --reporter JUnit::out=te-junit.xml
27+
cat te-junit.xml
28+
errors=$(cat te-junit.xml | grep -Po '(errors)="\K[^"]*')
29+
failures=$(cat te-junit.xml | grep -Po '(failures)="\K[^"]*')
2830
echo "Error count is: ${errors}"
2931
echo "Failure count is: ${failures}"
3032
if [ "$errors" -gt 0 ]; then
@@ -40,10 +42,10 @@ jobs:
4042
cmake -DTE_POW_FROM_RIGHT=1 ./
4143
make -j4
4244
cd bin
43-
./TETestRunner --reporter JUnit::out=TE-junit-pow-from-right.xml
44-
cat TE-junit-pow-from-right.xml
45-
errors=$(cat TE-junit-pow-from-right.xml | grep -Po '(errors)="\K[^"]*')
46-
failures=$(cat TE-junit-pow-from-right.xml | grep -Po '(failures)="\K[^"]*')
45+
./TETestRunner --reporter JUnit::out=te-junit-pow-from-right.xml
46+
cat te-junit-pow-from-right.xml
47+
errors=$(cat te-junit-pow-from-right.xml | grep -Po '(errors)="\K[^"]*')
48+
failures=$(cat te-junit-pow-from-right.xml | grep -Po '(failures)="\K[^"]*')
4749
echo "Error count is: ${errors}"
4850
echo "Failure count is: ${failures}"
4951
if [ "$errors" -gt 0 ]; then
@@ -59,10 +61,10 @@ jobs:
5961
cmake -DTE_FLOAT=1 ./
6062
make -j4
6163
cd bin
62-
./TETestRunner --reporter JUnit::out=TE-junit-float.xml
63-
cat TE-junit-float.xml
64-
errors=$(cat TE-junit-float.xml | grep -Po '(errors)="\K[^"]*')
65-
failures=$(cat TE-junit-float.xml | grep -Po '(failures)="\K[^"]*')
64+
./TETestRunner --reporter JUnit::out=te-junit-float.xml
65+
cat te-junit-float.xml
66+
errors=$(cat te-junit-float.xml | grep -Po '(errors)="\K[^"]*')
67+
failures=$(cat te-junit-float.xml | grep -Po '(failures)="\K[^"]*')
6668
echo "Error count is: ${errors}"
6769
echo "Failure count is: ${failures}"
6870
if [ "$errors" -gt 0 ]; then
@@ -78,10 +80,10 @@ jobs:
7880
cmake -DTE_LONG_DOUBLE=1 ./
7981
make -j4
8082
cd bin
81-
./TETestRunner --reporter JUnit::out=TE-junit-long-double.xml
82-
cat TE-junit-long-double.xml
83-
errors=$(cat TE-junit-long-double.xml | grep -Po '(errors)="\K[^"]*')
84-
failures=$(cat TE-junit-long-double.xml | grep -Po '(failures)="\K[^"]*')
83+
./TETestRunner --reporter JUnit::out=te-junit-long-double.xml
84+
cat te-junit-long-double.xml
85+
errors=$(cat te-junit-long-double.xml | grep -Po '(errors)="\K[^"]*')
86+
failures=$(cat te-junit-long-double.xml | grep -Po '(failures)="\K[^"]*')
8587
echo "Error count is: ${errors}"
8688
echo "Failure count is: ${failures}"
8789
if [ "$errors" -gt 0 ]; then
@@ -97,10 +99,10 @@ jobs:
9799
cmake -DTE_BITWISE_OPERATORS=1 ./
98100
make -j4
99101
cd bin
100-
./TETestRunner --reporter JUnit::out=TE-junit-bitwise.xml
101-
cat TE-junit-bitwise.xml
102-
errors=$(cat TE-junit-bitwise.xml | grep -Po '(errors)="\K[^"]*')
103-
failures=$(cat TE-junit-bitwise.xml | grep -Po '(failures)="\K[^"]*')
102+
./TETestRunner --reporter JUnit::out=te-junit-bitwise.xml
103+
cat te-junit-bitwise.xml
104+
errors=$(cat te-junit-bitwise.xml | grep -Po '(errors)="\K[^"]*')
105+
failures=$(cat te-junit-bitwise.xml | grep -Po '(failures)="\K[^"]*')
104106
echo "Error count is: ${errors}"
105107
echo "Failure count is: ${failures}"
106108
if [ "$errors" -gt 0 ]; then

0 commit comments

Comments
 (0)