diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2017-11-06 05:04:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-06 05:04:37 +0100 |
commit | d31b94ac209d2161f60084d5fa1e18f0cbaf0207 (patch) | |
tree | 9afbf06aaa972109fb218f56e6f3ba06ba7cd6d3 /test | |
parent | 04b3c327723587fa63f391884b8dfce44233cc77 (diff) | |
parent | 280943d9b938e95fcf77ef5290576630b84511fb (diff) | |
download | rneovim-d31b94ac209d2161f60084d5fa1e18f0cbaf0207.tar.gz rneovim-d31b94ac209d2161f60084d5fa1e18f0cbaf0207.tar.bz2 rneovim-d31b94ac209d2161f60084d5fa1e18f0cbaf0207.zip |
Merge #7188 from justinmk/doc
doc; minor runtime bug fixes
Diffstat (limited to 'test')
-rw-r--r-- | test/README.md | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/test/README.md b/test/README.md index 01db5960cd..44558f0981 100644 --- a/test/README.md +++ b/test/README.md @@ -1,31 +1,48 @@ -# Tests +Tests +===== Tests are run by `/cmake/RunTests.cmake` file, using busted. For some failures, `.nvimlog` (or `$NVIM_LOG_FILE`) may provide insight. -## Directory structure +Lint +---- -Directories with tests: `/test/benchmark` for benchmarks, `/test/functional` for -functional tests, `/test/unit` for unit tests. `/test/config` contains `*.in` -files (currently a single one) which are transformed into `*.lua` files using -`configure_file` CMake command: this is for acessing CMake variables in lua -tests. `/test/includes` contains include files for use by luajit `ffi.cdef` -C definitions parser: normally used to make macros not accessible via this -mechanism accessible the other way. +`make lint` (and `make testlint`) runs [luacheck](https://github.com/mpeterv/luacheck) +on the test code. -Files `/test/*/preload.lua` contain modules which will be preloaded by busted, -via `--helper` option. `/test/**/helpers.lua` contain various “library” -functions, (intended to be) used by a number of tests and not just a single one. +If a luacheck warning must be ignored, specify the warning code. Example: -`/test/*/**/*_spec.lua` are files containing actual tests. Files that do not end -with a `_spec.lua` are libraries like `/test/**/helpers.lua`, except that they -have some common topic. + -- luacheck: ignore 621 -Tests inside `/test/unit` and `/test/functional` are normally divided into -groups by the semantic component they are testing. +http://luacheck.readthedocs.io/en/stable/warnings.html -## Environment variables +Ignore the smallest applicable scope (e.g. inside a function, not at the top of +the file). + +Layout +------ + +- `/test/benchmark` : benchmarks +- `/test/functional` : functional tests +- `/test/unit` : unit tests +- `/test/config` : contains `*.in` files which are transformed into `*.lua` + files using `configure_file` CMake command: this is for acessing CMake + variables in lua tests. +- `/test/includes` : include-files for use by luajit `ffi.cdef` C definitions + parser: normally used to make macros not accessible via this mechanism + accessible the other way. +- `/test/*/preload.lua` : modules preloaded by busted `--helper` option +- `/test/**/helpers.lua` : common utility functions for test code +- `/test/*/**/*_spec.lua` : actual tests. Files that do not end with + `_spec.lua` are libraries like `/test/**/helpers.lua`, except that they have + some common topic. + +Tests in `/test/unit` and `/test/functional` are normally divided into groups +by the semantic component they are testing. + +Environment variables +--------------------- Test behaviour is affected by environment variables. Currently supported (Functional, Unit, Benchmarks) (when Defined; when set to _1_; when defined, |