Skip to content

Commit 442d17c

Browse files
authored
Reactivate CI regression tests for Windows + improve CI (#1117)
* CI Aggreate generated patches * CI Reactivate Windows regression tests * Ci Update C++20 test on Windows * CI exclude lines with Windows paths from git * CI Update mixed-default-arguments.cpp2 test
1 parent 4da0ab2 commit 442d17c

File tree

5 files changed

+56
-16
lines changed

5 files changed

+56
-16
lines changed

.github/workflows/regression-tests.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
bash run-tests.sh -c ${{ matrix.compiler }} -s ${{ matrix.cxx_std }} -d ${{ matrix.stdlib }} -l ${{ matrix.os }}
9393
9494
- name: Run regression tests - Windows version
95-
if: matrix.os == 'windows-latest'
95+
if: startsWith(matrix.os, 'windows')
9696
run: |
9797
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && ^
9898
git config --local core.autocrlf false && ^
@@ -101,9 +101,36 @@ jobs:
101101
shell: cmd
102102

103103
- name: Upload patch
104-
if: ${{ !cancelled() }}
104+
if: success() || failure()
105105
uses: actions/upload-artifact@v4
106106
with:
107107
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.cxx_std }}-${{ matrix.stdlib }}.patch
108108
path: regression-tests/${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.cxx_std }}-${{ matrix.stdlib }}.patch
109109
if-no-files-found: ignore
110+
111+
aggregate-results:
112+
needs: regression-tests
113+
if: success() || failure()
114+
runs-on: ubuntu-latest
115+
steps:
116+
- name: Download all patches
117+
uses: actions/download-artifact@v4
118+
with:
119+
path: downloaded-results
120+
121+
- name: Prepare result files
122+
id: prepare_files
123+
run: |
124+
mkdir aggregated-results
125+
echo "Flattening file hierarchy"
126+
find . -type f -wholename "./downloaded-results*" -exec mv {} aggregated-results \;
127+
patch_count=$(ls aggregated-results 2>/dev/null | wc -l)
128+
echo "patch_count=${patch_count}" >> $GITHUB_OUTPUT
129+
130+
- name: Upload aggregated results
131+
if: steps.prepare_files.outputs.patch_count != '0'
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: aggregated-results
135+
path: aggregated-results
136+
if-no-files-found: ignore

regression-tests/run-tests.sh

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ usage() {
1717
# If the diff is not empty print it with the provided message
1818
report_diff () {
1919
file="$1"
20-
diff_opt="$2"
21-
error_msg="$3"
22-
patch_file="$4"
20+
error_msg="$2"
21+
patch_file="$3"
22+
# The remaining arguments will be passed to git
23+
shift 3
24+
diff_opts="$@"
2325

2426
# Compare the content with the reference value checked in git
25-
diff_output=$(git diff "$diff_opt" -- "$file")
27+
diff_output=$(git diff $diff_opts -- "$file")
2628
if [[ -n "$diff_output" ]]; then
2729
echo " $error_msg:"
2830
echo " $file"
@@ -55,17 +57,21 @@ check_file () {
5557
git add "$file"
5658
# ... report the diff ...
5759
report_diff "$file" \
58-
"HEAD" \
5960
"The $description is not tracked by git" \
60-
"$patch_file"
61+
"$patch_file" \
62+
"HEAD"
6163
# ... and remove the file from the index
6264
git rm --cached -- "$file" > /dev/null 2>&1
6365
else
6466
# Compare the content with the reference value checked in git
67+
# Lines includng Windows paths are excluded from diff
68+
# This is necessary due to characters in those paths on GitHub runners
69+
# that cause git diff to spuriously flag them
6570
report_diff "$file" \
66-
"--ignore-cr-at-eol" \
6771
"Non-matching $description" \
68-
"$patch_file"
72+
"$patch_file" \
73+
--ignore-cr-at-eol \
74+
--ignore-matching-lines="C:\\\\"
6975
fi
7076
}
7177

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
1 "test"
2+
0 ""
3+
1 "test"
4+
0 ""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mixed-default-arguments.cpp
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
pure2-assert-expected-not-null.cpp
22
pure2-assert-expected-not-null.cpp2(7): error C2039: 'expected': is not a member of 'std'
3-
predefined C++ types (compiler internal)(348): note: see declaration of 'std'
3+
predefined C++ types (compiler internal)(347): note: see declaration of 'std'
44
pure2-assert-expected-not-null.cpp2(7): error C2062: type 'int' unexpected
55
pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' before '{'
66
pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' before '}'
77
pure2-assert-expected-not-null.cpp2(9): error C2065: 'ex': undeclared identifier
88
pure2-assert-expected-not-null.cpp2(9): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found
9-
..\..\..\include\cpp2util.h(632): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)'
9+
..\..\..\include\cpp2util.h(638): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)'
1010
pure2-assert-expected-not-null.cpp2(14): error C2039: 'expected': is not a member of 'std'
11-
predefined C++ types (compiler internal)(348): note: see declaration of 'std'
11+
predefined C++ types (compiler internal)(347): note: see declaration of 'std'
1212
pure2-assert-expected-not-null.cpp2(14): error C2062: type 'int' unexpected
1313
pure2-assert-expected-not-null.cpp2(14): error C2143: syntax error: missing ';' before '{'
1414
pure2-assert-expected-not-null.cpp2(14): error C2039: 'unexpected': is not a member of 'std'
15-
predefined C++ types (compiler internal)(348): note: see declaration of 'std'
16-
pure2-assert-expected-not-null.cpp2(14): error C3861: 'unexpected': identifier not found
15+
predefined C++ types (compiler internal)(347): note: see declaration of 'std'
16+
pure2-assert-expected-not-null.cpp2(14): error C2660: 'unexpected': function does not take 1 arguments
17+
C:\Program Files\Microsoft Visual Studio�2nterprise\VC\Tools\MSVC .40.33807\includeh.h(33): note: see declaration of 'unexpected'
18+
pure2-assert-expected-not-null.cpp2(14): note: while trying to match the argument list '(bool)'
1719
pure2-assert-expected-not-null.cpp2(14): error C2143: syntax error: missing ';' before '}'
1820
pure2-assert-expected-not-null.cpp2(15): error C2065: 'ex': undeclared identifier
1921
pure2-assert-expected-not-null.cpp2(15): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found
20-
..\..\..\include\cpp2util.h(632): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)'
22+
..\..\..\include\cpp2util.h(638): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)'

0 commit comments

Comments
 (0)