Skip to content

Commit 2a68c94

Browse files
committed
Run the tests where a feature is switched off
These six jobs only compiled. Nothing was stopping them from running, and what they cover is not covered anywhere else: STDC_EXCEPTIONS is decided per translation unit from __cpp_exceptions, and both options are private to the library target, so the tests build the ordinary way and exercise a library whose #ifdefs came out the other way. Popen's exception-free path had never been executed by anything. Checked before turning them on, in the configuration the jobs actually use, which is the static default rather than the shared one the other jobs pass: both options build and run all 190 cases on MSVC. The cost is Boost.Test on three more platforms, which the shared setup action already knows how to install.
1 parent 432d78a commit 2a68c94

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ jobs:
8787
#
8888
# Three platforms rather than five: the flag is chosen by MSVC against not-MSVC, and these
8989
# three are the MSVC standard library, libstdc++ and libc++.
90+
#
91+
# Both flags are private to the library target, so the tests are built the ordinary way and run
92+
# against a library that was not. That is the same split a consumer gets, and it is the only
93+
# thing here that reaches the library's exception-free branches at run time: STDC_EXCEPTIONS is
94+
# worked out per translation unit from __cpp_exceptions, so the code the #ifdefs in popen and
95+
# elsewhere select is compiled by these two jobs and by nothing else.
9096
no-features:
9197
name: ${{ matrix.platform }} ${{ matrix.config }}
9298
runs-on: ${{ matrix.os }}
@@ -118,11 +124,15 @@ jobs:
118124
no-exceptions) flags="-DSTDC_ENABLE_EXCEPTIONS=OFF" ;;
119125
no-rtti) flags="-DSTDC_ENABLE_RTTI=OFF" ;;
120126
esac
121-
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Debug -DSTDC_BUILD_TESTS=OFF $flags
127+
cmake -G Ninja -S . -B build -DCMAKE_BUILD_TYPE=Debug -DSTDC_BUILD_TESTS=ON $flags
122128
123129
- name: Build
124130
run: cmake --build build
125131

132+
- name: Test
133+
shell: bash
134+
run: ./build/bin/test_auto
135+
126136
# MinGW builds the library but does not run the tests: Boost.Test for MinGW is its own
127137
# undertaking, and what is worth knowing here is that the Windows sources compile and link
128138
# against something other than the Microsoft toolchain.

0 commit comments

Comments
 (0)