TLDR: run v test-all
locally, after making your changes,
and before submitting PRs.
In the v
repo there are several different tests. The main types are:
_test.v
tests - check thattest_
functions succeed. These can be run per directory or individually..out
tests - run a.vv
file and check the output matches the contents of the.out
file with the same base name. This is particularly useful for checking that errors are printed.
Tip: use v -cc tcc
when compiling tests for speed.
General runnable tests for different features of the V compiler.
vlib/v/tests/inout/compiler_test.v
Test output of running a V program matches an expected .out file. Check the source for how to test panics.
v build-tools
v build-examples
v build-vbinaries
In vlib/v/fmt/
there are::
v vlib/v/fmt/fmt_test.v
This checks .out
tests.
v vlib/v/fmt/fmt_keep_test.v
This verifies that _keep.v
files would be unchanged by vfmt -w
.
v vlib/v/fmt/fmt_vlib_test.v
This checks all source files are formatted and prints a summary. This is not required.
v test-fmt
Test all files in the current directory are formatted.
v check-md -hide-warnings .
Ensure that all .md files in the project are formatted properly, and that the V code block examples in them can be compiled/formatted too.
This runs various CI tests, e.g.:
v vet vlib/v
- style checkerv fmt -verify
on certain source files
Check that most .v files, are invariant of v fmt
runs.
Run vlib
module tests, including the compiler tests.
This runs tests for:
checker/tests/*.vv
parser/tests/*.vv
Test and build everything. Usefull to verify locally, that the CI will most likely pass. Slowest, but most comprehensive.
It works, by running these in succession:
v test-cleancode
v test-self
v test-fmt
v build-tools
v build-examples
v check-md -hide-warnings .
v install nedpals.args