Skip to content

infra: individual test executables - #1212

Merged
Carson Radtke (carsonRadtke) merged 12 commits into
mainfrom
carsonradtke/individual-tests
Dec 5, 2025
Merged

Carson Radtke (carsonRadtke) merged 12 commits into
mainfrom
carsonradtke/individual-tests

Conversation

@carsonRadtke

@carsonRadtke Carson Radtke (carsonRadtke) commented Aug 21, 2025

Copy link
Copy Markdown
Member

We used have tests contained in a single executable. This was fine for testing, but it would be more convient to separate tests into indivudal modules so targeted changes could have targeted tests.

This change associates each test file with its own executable. We now have 14 tests for GSL each of which testing a different component.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modernizes the GSL test infrastructure by separating tests from a single monolithic executable into individual test executables for each component. This change improves development workflow by enabling targeted testing of specific components.

  • Splits the single gsl_tests executable into 14 individual test executables, one per test source file
  • Simplifies MSVC version checks in span tests to focus on C++14 compatibility instead of specific compiler versions
  • Maintains the same test coverage while improving modularity and development experience

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/CMakeLists.txt Refactors build system to create individual executables for each test source file using a foreach loop
tests/span_tests.cpp Simplifies MSVC version checks by removing specific version numbers and focusing on C++14 standard

Comment thread tests/span_tests.cpp
We used have tests contained in a single executable. This was fine for
testing, but it would be more convient to separate tests into indivudal
modules so targeted changes could have targeted tests.

This change associates each test file with its own executable. We now
have 14 tests for GSL each of which testing a different component.
thanks copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@carsonRadtke Carson Radtke (carsonRadtke) added Status: Review Needed Needs review from GSL maintainers and removed Status: In Progress Currently being worked on labels Dec 4, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-project-automation github-project-automation Bot moved this from Ready for Review to Approved in Microsoft/GSL Pull Requests In-Flight Dec 5, 2025
Comment thread tests/CMakeLists.txt

Copilot AI commented Dec 5, 2025

Copy link
Copy Markdown
Contributor

Carson Radtke (@carsonRadtke) I've opened a new pull request, #1227, to work on those changes. Once the pull request is ready, I'll request review from you.

* Initial plan

* Use file globbing for test sources instead of manual list

Replace the manually maintained list of test sources with file(GLOB) to
automatically discover all .cpp files in the tests directory, excluding
no_exception_ensure_tests.cpp which needs special compilation flags.

This approach:
- Automatically picks up new test files without CMake updates
- Still correctly excludes no_exception_ensure_tests.cpp
- Maintains the same test build configuration
- Works with both C++14 and C++20

Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: carsonRadtke <10507970+carsonRadtke@users.noreply.github.com>
@carsonRadtke
Carson Radtke (carsonRadtke) merged commit 756c91a into main Dec 5, 2025
90 checks passed
@carsonRadtke
Carson Radtke (carsonRadtke) deleted the carsonradtke/individual-tests branch December 5, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Review Needed Needs review from GSL maintainers Type: Infra Changes to build system, tests, or pipelines

Projects

Development

Successfully merging this pull request may close these issues.

4 participants