dynamic_tapping_term: add unit tests#26338
Draft
arcaartem wants to merge 3 commits into
Draft
Conversation
13 tasks
Add a test suite under tests/dynamic_tapping_term covering the DYNAMIC_TAPPING_TERM_ENABLE feature: the initial value of g_tapping_term matches the configured TAPPING_TERM, DT_UP raises it by DYNAMIC_TAPPING_TERM_INCREMENT per press, and DT_DOWN lowers it by the same amount per press. No prior test coverage existed for this feature. Give the fixture a destructor that restores g_tapping_term to TAPPING_TERM after every test, so InitialTappingTermMatchesConfiguredDefault does not depend on running before the other tests mutate the global tapping term. Verified order-independence by running the suite with --gtest_shuffle across many seeds.
arcaartem
force-pushed
the
dynamic-tapping-term-tests
branch
from
July 16, 2026 17:38
907e674 to
e547be4
Compare
Author
|
Made the suite order-independent: the fixture now restores g_tapping_term to TAPPING_TERM after every test (verified with --gtest_shuffle across repeated runs), and an unused using-declaration was removed. |
zvecr
reviewed
Jul 16, 2026
Co-authored-by: Joel Challis <git@zvecr.com>
…c term Exercise the feature end to end: the same hold duration resolves as a tap under the default tapping term, then as a hold after DT_DOWN lowers the term below it. This pins the GET_TAPPING_TERM -> g_tapping_term wiring that the arithmetic-only tests do not cover.
Author
|
Removed the initial-value test as suggested. To keep the suite meaningful beyond increment arithmetic, added an end-to-end test (LoweredTappingTermChangesModTapResolution): the same hold duration resolves as a tap under the default tapping term and as a hold after DT_DOWN lowers the term below it, exercising tap-hold resolution through g_tapping_term at resolution time. Suite passes locally including --gtest_shuffle repeats. |
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.
Description
There is currently no unit-test coverage for
quantum/process_keycode/process_dynamic_tapping_term.c. This adds a smalltests/dynamic_tapping_termsuite covering the feature's baseline behavior:g_tapping_termmatches the configuredTAPPING_TERMDT_UPraisesg_tapping_termbyDYNAMIC_TAPPING_TERM_INCREMENTper pressDT_DOWNlowers it by the same amount per pressThe fixture restores
g_tapping_termtoTAPPING_TERMafter every test, so the suite does not depend on test execution order (verified with--gtest_shuffleacross repeated runs).All tests pass on current
develop(make test:dynamic_tapping_term, 3 tests). This is groundwork for the fix in the follow-up PR, which adds an underflow regression test to this suite alongside its one-line guard.Types of Changes
Checklist
qmk format-cclean; test boilerplate matches the existing suites (tests/tri_layer,tests/auto_shift).developbranch.make test:dynamic_tapping_termpasses locally (3/3).