Skip to content

feat: Support --target default to run only untargeted tests#25

Merged
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:feat/target-default
Mar 15, 2026
Merged

feat: Support --target default to run only untargeted tests#25
haugoug merged 1 commit intogvsoc:mainfrom
germainh512:feat/target-default

Conversation

@germainh512
Copy link

Feature

--target default now selects only tests that have no target defined in gvtest.yaml.

Command Behavior
gvtest Run everything
gvtest --target X Only tests for target X
gvtest --target default Only untargeted tests
gvtest --target default --target X Untargeted + target X

Implementation

  • New _cli_targets_explicit flag tracks whether --target was passed (can't check the value since ['default'] is also the no-flag default)
  • Enqueue filter in TestCommon.enqueue() handles all combinations: fallback tests only run when default is requested, real targets only run when their name is requested
  • _resolve_targets_for_dir() filters YAML targets by the non-default entries in the target list

Tests

2 new tests, 144 total passing.

Adds 'default' as a special target keyword:

- `gvtest --target default`: runs only tests that have no
  target defined in gvtest.yaml (untargeted tests).
- `gvtest --target default --target X`: runs both untargeted
  tests and tests for target X.
- `gvtest --target X`: runs only tests for target X (unchanged).
- `gvtest` (no --target): runs everything (unchanged).

Implementation:
- Track whether --target was explicitly passed via
  _cli_targets_explicit flag (can't rely on checking the value
  since 'default' is also the no-target default).
- Enqueue filter checks both fallback status and target name
  membership in the requested list.
- _resolve_targets_for_dir filters YAML targets by the
  non-'default' entries in target_names.

Added 2 tests for --target default behavior.
@germainh512 germainh512 force-pushed the feat/target-default branch from e47cc91 to c1c64d9 Compare March 15, 2026 21:14
@haugoug haugoug merged commit 6255bab into gvsoc:main Mar 15, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants