diff --git a/.github/workflows/regression-tests.yml b/.github/workflows/regression-tests.yml index 96071e977..671a892c5 100644 --- a/.github/workflows/regression-tests.yml +++ b/.github/workflows/regression-tests.yml @@ -92,7 +92,7 @@ jobs: bash run-tests.sh -c ${{ matrix.compiler }} -s ${{ matrix.cxx_std }} -d ${{ matrix.stdlib }} -l ${{ matrix.os }} - name: Run regression tests - Windows version - if: matrix.os == 'windows-latest' + if: startsWith(matrix.os, 'windows') run: | "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" && ^ git config --local core.autocrlf false && ^ @@ -101,9 +101,36 @@ jobs: shell: cmd - name: Upload patch - if: ${{ !cancelled() }} + if: success() || failure() uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.cxx_std }}-${{ matrix.stdlib }}.patch path: regression-tests/${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.cxx_std }}-${{ matrix.stdlib }}.patch if-no-files-found: ignore + + aggregate-results: + needs: regression-tests + if: success() || failure() + runs-on: ubuntu-latest + steps: + - name: Download all patches + uses: actions/download-artifact@v4 + with: + path: downloaded-results + + - name: Prepare result files + id: prepare_files + run: | + mkdir aggregated-results + echo "Flattening file hierarchy" + find . -type f -wholename "./downloaded-results*" -exec mv {} aggregated-results \; + patch_count=$(ls aggregated-results 2>/dev/null | wc -l) + echo "patch_count=${patch_count}" >> $GITHUB_OUTPUT + + - name: Upload aggregated results + if: steps.prepare_files.outputs.patch_count != '0' + uses: actions/upload-artifact@v4 + with: + name: aggregated-results + path: aggregated-results + if-no-files-found: ignore diff --git a/regression-tests/run-tests.sh b/regression-tests/run-tests.sh index 6640786fa..b0a41359a 100644 --- a/regression-tests/run-tests.sh +++ b/regression-tests/run-tests.sh @@ -17,12 +17,14 @@ usage() { # If the diff is not empty print it with the provided message report_diff () { file="$1" - diff_opt="$2" - error_msg="$3" - patch_file="$4" + error_msg="$2" + patch_file="$3" + # The remaining arguments will be passed to git + shift 3 + diff_opts="$@" # Compare the content with the reference value checked in git - diff_output=$(git diff "$diff_opt" -- "$file") + diff_output=$(git diff $diff_opts -- "$file") if [[ -n "$diff_output" ]]; then echo " $error_msg:" echo " $file" @@ -55,17 +57,21 @@ check_file () { git add "$file" # ... report the diff ... report_diff "$file" \ - "HEAD" \ "The $description is not tracked by git" \ - "$patch_file" + "$patch_file" \ + "HEAD" # ... and remove the file from the index git rm --cached -- "$file" > /dev/null 2>&1 else # Compare the content with the reference value checked in git + # Lines includng Windows paths are excluded from diff + # This is necessary due to characters in those paths on GitHub runners + # that cause git diff to spuriously flag them report_diff "$file" \ - "--ignore-cr-at-eol" \ "Non-matching $description" \ - "$patch_file" + "$patch_file" \ + --ignore-cr-at-eol \ + --ignore-matching-lines="C:\\\\" fi } diff --git a/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.execution b/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.execution new file mode 100644 index 000000000..98b5204b6 --- /dev/null +++ b/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.execution @@ -0,0 +1,4 @@ +1 "test" +0 "" +1 "test" +0 "" diff --git a/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.output b/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.output index e69de29bb..dc74a2a38 100644 --- a/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.output +++ b/regression-tests/test-results/msvc-2022-c++20/mixed-default-arguments.cpp.output @@ -0,0 +1 @@ +mixed-default-arguments.cpp diff --git a/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output b/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output index f2e012a95..95f9406df 100644 --- a/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output +++ b/regression-tests/test-results/msvc-2022-c++20/pure2-assert-expected-not-null.cpp.output @@ -1,20 +1,22 @@ pure2-assert-expected-not-null.cpp pure2-assert-expected-not-null.cpp2(7): error C2039: 'expected': is not a member of 'std' -predefined C++ types (compiler internal)(348): note: see declaration of 'std' +predefined C++ types (compiler internal)(347): note: see declaration of 'std' pure2-assert-expected-not-null.cpp2(7): error C2062: type 'int' unexpected pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' before '{' pure2-assert-expected-not-null.cpp2(7): error C2143: syntax error: missing ';' before '}' pure2-assert-expected-not-null.cpp2(9): error C2065: 'ex': undeclared identifier pure2-assert-expected-not-null.cpp2(9): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found -..\..\..\include\cpp2util.h(632): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)' +..\..\..\include\cpp2util.h(638): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)' pure2-assert-expected-not-null.cpp2(14): error C2039: 'expected': is not a member of 'std' -predefined C++ types (compiler internal)(348): note: see declaration of 'std' +predefined C++ types (compiler internal)(347): note: see declaration of 'std' pure2-assert-expected-not-null.cpp2(14): error C2062: type 'int' unexpected pure2-assert-expected-not-null.cpp2(14): error C2143: syntax error: missing ';' before '{' pure2-assert-expected-not-null.cpp2(14): error C2039: 'unexpected': is not a member of 'std' -predefined C++ types (compiler internal)(348): note: see declaration of 'std' -pure2-assert-expected-not-null.cpp2(14): error C3861: 'unexpected': identifier not found +predefined C++ types (compiler internal)(347): note: see declaration of 'std' +pure2-assert-expected-not-null.cpp2(14): error C2660: 'unexpected': function does not take 1 arguments +C:\Program Files\Microsoft Visual Studio‚2nterprise\VC\Tools\MSVC .40.33807\includeh.h(33): note: see declaration of 'unexpected' +pure2-assert-expected-not-null.cpp2(14): note: while trying to match the argument list '(bool)' pure2-assert-expected-not-null.cpp2(14): error C2143: syntax error: missing ';' before '}' pure2-assert-expected-not-null.cpp2(15): error C2065: 'ex': undeclared identifier pure2-assert-expected-not-null.cpp2(15): error C2672: 'cpp2::impl::assert_not_null': no matching overloaded function found -..\..\..\include\cpp2util.h(632): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)' +..\..\..\include\cpp2util.h(638): note: could be 'decltype(auto) cpp2::impl::assert_not_null(_T0 &&)'