1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

tests: add v test-all, move v test-fixed to v test-compiler-full

This commit is contained in:
Delyan Angelov
2021-01-17 16:04:08 +02:00
parent e4850cd6dd
commit 460f32baf2
14 changed files with 226 additions and 166 deletions

View File

@ -1,5 +1,9 @@
# Automated tests
TLDR: run `v test-all` locally, after making your changes,
and before submitting PRs.
## Notes
In the `v` repo there are several different tests. The main types are:
* `_test.v` tests - check that `test_` functions succeed. These can be
@ -10,61 +14,74 @@ particularly useful for checking that errors are printed.
Tip: use `v -cc tcc` when compiling tests for speed.
## `v test-compiler`
This builds and tests:
* `vc` repo
* `_test.v` files
* examples
* `v install` a module
Some of these can be invoked separately.
## `vlib/v/compiler_errors_test.v`
This runs tests for:
* `checker/tests/*.vv`
* `parser/tests/*.vv`
## `vlib/v/tests`
General runnable program tests.
General runnable tests for different features of the V compiler.
## Actual code
## Test building of actual V programs (examples, tools, V itself)
* `v build-examples`
* `v build-tools`
## `v test-fixed`
Test `vlib`.
* `v build-examples`
* `v build-vbinaries`
## vfmt tests
In `vlib/v/fmt/` there's:
In `vlib/v/fmt/` there are::
* `fmt_test.v`
* `v vlib/v/fmt/fmt_test.v`
This checks `.out` tests.
* `fmt_keep_test.v`
* `v vlib/v/fmt/fmt_keep_test.v`
This verifies that `_keep.v` files would be unchanged by `vfmt -w`.
* `fmt_vlib_test.v`
* `v vlib/v/fmt/fmt_vlib_test.v`
This checks all source files are formatted and prints a summary. This
is not required.
This checks all source files are formatted and prints a summary.
This is not required.
## Other
* `v test-fmt`
Test all files in the current directory are formatted.
* `v run cmd/tools/check-md.v -hide-warnings -all`
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.
## `.github/workflows/ci.yml`
This runs various CI tests, e.g.:
* `v vet vlib/v` - style checker
* `v fmt -verify` on certain source files
## `v test-cleancode`
Check that most .v files, are invariant of `v fmt` runs.
## `v test-compiler-full`
Run `vlib` module tests, *including* the compiler tests.
## `v vlib/v/compiler_errors_test.v`
This runs tests for:
* `checker/tests/*.vv`
* `parser/tests/*.vv`
## `v test-all`
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-compiler-full`
* `v test-fmt`
* `v build-tools`
* `v build-examples`
* `v run cmd/tools/check-md.v -hide-warnings -all`
* `v install nedpals.args`