Add tests and CI jobs for warnings features - #35
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a small warnings-feature test suite to the tests/ Bazel module and wires it into CI, so the GCC warnings feature flags are continuously validated (both “no false positives” and “does it actually catch a known violation”).
Changes:
- Add a GCC warnings “positive”
cc_testplus three manual “violation”cc_librarytargets (minimal/strict/all). - Register a dedicated GCC 15.3.0 toolchain for warnings-feature testing and add
.bazelrcconfigs to pin it and enable the relevant features. - Add a new GitHub Actions job to run the positive test and verify each violation target fails with the expected diagnostic; document how to run these locally.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/warnings/strict_violation.cpp | Adds an intentional -Wvla violation source used for negative validation under strict warnings. |
| tests/warnings/positive_test.cpp | Adds a minimal “should compile clean” test used to detect false positives under -Werror. |
| tests/warnings/minimal_violation.cpp | Adds an intentional -Wcast-qual violation source used for negative validation under minimal warnings. |
| tests/warnings/all_violation.cpp | Adds an intentional -Wunused-variable violation source used for negative validation under all-wall warnings. |
| tests/MODULE.bazel | Adds a dedicated GCC 15.3.0 toolchain and required deps for warnings-feature testing. |
| tests/BUILD.bazel | Registers the new positive test and manual violation targets. |
| tests/.bazelrc | Adds configs that pin the GCC 15 toolchain and enable warnings features + warnings_as_errors. |
| docs/warnings.md | Documents how the warnings features are tested in tests/ and CI. |
| .github/workflows/tests.yml | Adds a CI job matrix to run the positive test and validate expected failures for each warnings level. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+366
to
+370
| `minimal_warnings_violation`, `strict_warnings_violation`, and | ||
| `all_wall_warnings_violation` are `cc_library` targets tagged `manual`, | ||
| each containing one documented, intentional violation (see the header | ||
| comment in the corresponding `tests/warnings/*_violation.cpp` file). They | ||
| must **fail to build** under their matching config: |
nradakovic
force-pushed
the
nira_warnings_tests
branch
4 times, most recently
from
August 27, 2026 09:17
71cc0b1 to
0c57db5
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
.github/workflows/tests.yml:172
warnings_as_errorsis implemented as-Werror, so the diagnostic emitted for the VLA case is expected to reference-Wvlarather than-Werror=vla. Using-Werror=vlahere may cause the negative test to fail even though the warning was correctly triggered.
- label: strict_warnings
config: feature_only_gcc_strict_warnings
violation_target: strict_warnings_violation
expected_diagnostic: "-Werror=vla"
- label: all_wall_warnings
.github/workflows/tests.yml:176
- For the unused-variable violation, the GCC option shown in diagnostics is expected to be
-Wunused-variable(often[-Wunused-variable]). Withwarnings_as_errorsimplemented via-Werror, grepping for-Werror=unused-variablemay not match the actual output.
- label: all_wall_warnings
config: feature_only_gcc_all_wall_warnings
violation_target: all_wall_warnings_violation
expected_diagnostic: "-Werror=unused-variable"
Comment on lines
+164
to
+168
| - label: minimal_warnings | ||
| config: feature_only_gcc_minimal_warnings | ||
| violation_target: minimal_warnings_violation | ||
| expected_diagnostic: "-Werror=cast-qual" | ||
| - label: strict_warnings |
Add tests and CI jobs for warnings features.
nradakovic
force-pushed
the
nira_warnings_tests
branch
from
August 27, 2026 09:40
0c57db5 to
da8b0d1
Compare
Comment on lines
+178
to
+180
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
antonkri
approved these changes
Aug 27, 2026
This was
linked to
issues
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add tests and CI jobs for warnings features.