[RFC PATCH v3 0/1] Add a project document for adding unit tests
- From
Josh Steadmon <steadmon@google.com>
- Date
- Jun 9, 2023, 23:25 UTC
- Message-ID
- <c7729b66a42b77dfe9ef61ba7c81e78e00b4021d.1686352386.git.steadmon@google.com>
- In-Reply-To
- <20230517-unit-tests-v2-v2-0-21b5b60f4b32@google.com>
In our current testing environment, we spend a significant amount of effort crafting end-to-end tests for error conditions that could easily be captured by unit tests (or we simply forgo some hard-to-setup and rare error conditions). Unit tests additionally provide stability to the codebase and can simplify debugging through isolation. Turning parts of Git into libraries[1] gives us the ability to run unit tests on the libraries and to write unit tests in C. Writing unit tests in pure C, rather than with our current shell/test-tool helper setup, simplifies test setup, simplifies passing data around (no shell-isms required), and reduces testing runtime by not spawning a separate process for every test invocation.
This patch adds a project document describing our goals for adding unit tests, as well as a discussion of features needed from prospective test frameworks or harnesses. It also includes a WIP comparison of various proposed frameworks. Later iterations of this series will probably include a sample unit test and Makefile integration once we've settled on a framework.
In addition to reviewing the document itself, reviewers can help this series progress by helping to fill in the framework comparison table.
[1] https://lore.kernel.org/git/CAJoAoZ=Cig_kLocxKGax31sU7Xe4==BGzC__Bg2_pr7krNq6MA@mail.gmail.com/# You can add trailers to the cover letter. Any email addresses found in
Changes in v3: - Expand the doc with discussion of desired features and a WIP comparison. - Drop all implementation patches until a framework is selected. - Link to v2: https://lore.kernel.org/r/20230517-unit-tests-v2-v2-0-21b5b60f4b32@google.com
Josh Steadmon (1):
unit tests: Add a project plan documentDocumentation/Makefile | 1 + Documentation/technical/unit-tests.txt | 141 ++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+)
base-commit: 69c786637d7a7fe3b2b8f7d989af095f5f49c3a8
-- 2.41.0.162.gfafddb0af9-goog