vix tests
vix tests runs project tests.
Use it when you want to execute the test suite of a Vix or CMake project with a clean Vix-native output.
Overview
vix tests is the test runner command of the Vix CLI.
It detects the current project, resolves the build directory from the selected preset, runs the available test backend, summarizes results, and reports failures with a clean Vix diagnostic format.
Even when Vix uses CTest internally, the command stays a Vix command from the user's point of view.
Usage
bashvix tests [path] [options] [-- raw-runner-args...]
1
What it does
vix tests can:
- run all tests in the current project
- run tests in another project directory
- run tests from a selected preset
- run a single test or a filtered group of tests
- list tests
- stop on the first failure
- run tests in watch mode
- run runtime checks after tests
- show clean Vix test diagnostics
- show more structured details with
-v - show raw internal runner output with
--raw - pass raw internal runner arguments after
--
Basic usage
bash# Run tests in the current project
vix tests
# Run tests in another project
vix tests ./examples/blog
# Run tests with a specific preset
vix tests --preset release
1
2
3
4
5
6
7
8
Output style
vix tests uses the same visual style as vix build.
Example success:
bashTesting all (dev)
* engine: vix | jobs: 8
tests [============================] done
✔ Passed 23 tests in 0.1s
1
2
3
4
Example failure:
bashTesting all (dev)
* engine: vix | jobs: 8
tests [============================] failed
✖ Failed 1 of 23 tests after 0.1s
failed:
kv_test_open
error:
FAILED: fast database should not be memory_only
➜ Run `vix tests -v` to show detailed Vix test output.
➜ Run `vix tests --raw` to show raw runner output.
1
2
3
4
5
6
7
8
9
10
11
12
13
By default, Vix does not dump the raw internal runner output. It extracts the useful failure information and presents it clearly.
Run all tests
This runs the test suite for the current project.
Vix resolves the build directory from the active preset. If no preset is provided, it uses dev-ninja.
Run tests from another project
bashvix tests ./examples/blog
1
The first path-like argument is treated as the project directory.
Presets
bashvix tests --preset release
1
If no preset is provided, Vix defaults to:
Common presets:
bashvix tests --preset dev
vix tests --preset dev-ninja
vix tests --preset release
1
2
3
Preset mapping:
| Preset | Build directory |
|---|
dev | build-dev |
dev-ninja | build-ninja |
release | build-release |
Run one test
Use --test to run one test or tests matching a pattern.
bashvix tests --test kv_test_segment
1
You can also use -R as an alias:
bashvix tests -R kv_test_segment
1
This is the Vix-native way to do what you would normally do with:
bashctest --test-dir build-ninja -R kv_test_segment --output-on-failure
1
But with vix tests, you do not need to think about the build directory or the internal runner.
Example output:
bashTesting kv_test_segment (dev)
* engine: vix | jobs: 8
tests [============================] done
✔ Passed 1 test in 0.1s
1
2
3
4
Run tests matching a pattern
--test accepts a name or pattern.
bashvix tests --test kv_test
vix tests --test persistence
vix tests -R wal
1
2
3
This is useful when you want to focus on a specific area while developing.
Verbose mode
Use -v or --verbose to show more Vix-formatted details.
bashvix tests -v
vix tests --verbose
1
2
-v should not expose raw internal runner output. It keeps the Vix interface and shows structured details.
Example:
bashTesting all (dev)
* engine: vix | jobs: 8
tests [============================] failed
✖ Failed 1 of 23 tests after 0.1s
failed:
kv_test_open
error:
FAILED: fast database should not be memory_only
details:
kv_test_open
FAILED: fast database should not be memory_only
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Raw mode
Use --raw only when you want to inspect the raw output of the internal test runner.
Raw mode is useful when debugging the runner itself or when you need the exact backend output.
Example:
bashvix tests --test kv_test_segment --raw
1
Normal development should use:
bashvix tests
vix tests -v
vix tests --test name
1
2
3
Jobs and parallel execution
vix tests runs tests with parallel execution when supported.
Example output:
bashTesting all (dev)
* engine: vix | jobs: 8
tests [============================] done
✔ Passed 23 tests in 0.1s
1
2
3
4
The jobs value is derived from available CPU threads, with a safe upper limit.
When Vix uses CTest internally, it passes parallel execution to the runner automatically.
Watch mode
Use --watch to watch project files and re-run tests when files change.
Vix watches relevant project files such as:
.cpp.cc.cxx.hpp.hh.hxx.h.cmakeCMakeLists.txtCMakePresets.json
It ignores generated or unrelated directories such as:
.git.idea.vscode- build directories
dist
Run runtime checks after tests
Use --run to run runtime checks after tests pass.
If tests fail, runtime checks are not executed.
This is useful when you want:
texttests first, runtime validation second
1
List tests
This lists available tests for the current project.
You can combine it with a pattern:
bashvix tests --list --test kv
vix tests --list -R wal
1
2
Fail fast
Use --fail-fast to stop after the first failing test.
bashvix tests --fail-fast
1
This is useful when you want fast feedback during debugging.
Raw runner arguments
Arguments after -- are passed to the internal test runner.
bashvix tests -- --output-on-failure
vix tests -- -R MySuite
vix tests -- --output-on-failure -R Auth
1
2
3
For normal Vix usage, prefer the Vix-native options:
bashvix tests -v
vix tests --test MySuite
vix tests --raw
1
2
3
Use raw runner arguments only when you need a backend-specific option.
Native runner and fallback
vix tests prefers a native test runner when available.
If no native runner is found, Vix falls back to the available project test backend.
The interface remains the same:
Vix should not make the command feel like a direct CTest wrapper. Internal tools are implementation details.
When tests are not configured yet
If the build directory does not exist or tests were not generated, Vix reports a clear message.
Example:
text✖ No build directory found for tests.
➜ Run `vix build --build-target all` first.
1
2
Recommended setup:
bashvix build --build-target all
vix tests
1
2
Options
| Option | Description |
|---|
--watch | Watch files and rerun tests on changes. |
--run | Run runtime checks after tests pass. |
--list | List available tests. |
--test <name|pattern> | Run tests matching a name or pattern. |
-R <name|pattern> | Alias for --test. |
--fail-fast | Stop after the first failing test. |
-v, --verbose | Show detailed Vix-formatted test output. |
--raw | Show raw internal test runner output. |
--preset <name> | Use a specific preset. |
-- | Pass raw arguments to the internal test runner. |
-h, --help | Show command help. |
Common workflows
bash# Run all tests
vix tests
# Run tests while editing
vix tests --watch
# Run tests and runtime checks
vix tests --run
# Run tests in release preset
vix tests --preset release
# List tests
vix tests --list
# Stop on first failure
vix tests --fail-fast
# Show detailed Vix output
vix tests -v
# Show raw internal runner output
vix tests --raw
# Run one test
vix tests --test kv_test_segment
# Run one test with short syntax
vix tests -R kv_test_segment
# Run tests matching a pattern
vix tests --test wal
# Run one test in release mode
vix tests --preset release --test kv_test_segment
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Common mistakes
Using raw runner syntax when Vix has a native option
Avoid this for normal usage:
bashvix tests -- -R kv_test_segment --output-on-failure
1
Prefer:
bashvix tests --test kv_test_segment
1
Or:
bashvix tests -R kv_test_segment
1
Expecting -v to show raw backend output
-v shows detailed Vix-formatted output.
For raw backend output, use:
Forgetting to build tests first
If tests were not generated yet, run:
bashvix build --build-target all
vix tests
1
2
Passing raw runner options without --
Wrong:
bashvix tests --output-on-failure
1
Correct:
bashvix tests -- --output-on-failure
1
But for most cases, prefer:
Confusing build preset and log level
Wrong:
bashVIX_LOG_LEVEL=release vix tests
1
Correct:
bashvix tests --preset release
1
VIX_LOG_LEVEL controls logging. --preset release controls the build/test preset.
Troubleshooting
Need to see the failing test message
Vix shows the first useful failure message automatically.
For more structured detail:
For raw backend output:
Need to run only one failing test
bashvix tests --test kv_test_open
1
Or:
bashvix tests -R kv_test_open
1
Need to stop after the first failure
bashvix tests --fail-fast
1
Need to list tests
Need to run tests from another folder
bashvix tests ./examples/blog
1
Need to use release mode
bashvix build --preset release --build-target all
vix tests --preset release
1
2
Recommended validation flow
During development:
When debugging one failure:
bashvix tests --test failing_test_name
vix tests -v --test failing_test_name
1
2
Before committing:
bashvix fmt --check
vix build --build-target all
vix tests
1
2
3
For stricter validation:
bashvix check --san --tests
1
For release preparation:
bashvix build --preset release --build-target all
vix tests --preset release
vix check --san --full
1
2
3
Difference between vix tests, vix check --tests, and raw runner usage
| Command | Purpose |
|---|
vix tests | Run tests with clean Vix-native output. |
vix tests -v | Run tests with detailed Vix-formatted output. |
vix tests --raw | Show raw internal runner output. |
vix check --tests | Run tests as part of the broader validation workflow. |
vix tests -- ... | Pass backend-specific arguments to the internal runner. |
Related commands
| Command | Purpose |
|---|
vix check --tests | Build and run tests as part of validation. |
vix check --san --tests | Run tests with sanitizers. |
vix build | Configure and build the project. |
vix fmt | Format source files. |
vix dev | Run the app in development mode. |
vix run | Build and run an application manually. |
Next step
Continue with reusable project tasks.
Open the vix task guide