Commit graph

19 commits

Author SHA1 Message Date
Matt Sturgeon
00586f8f1b
modules/output: move symlinkJoin to build.package 2025-01-20 14:49:59 +00:00
Matt Sturgeon
ff29c97723
modules/test: provide access to expect function
Allow `test.warnings` and `test.assertions` to be defined as either a
list, or a function coerced to a list.

When defined as a function, it is supplied an `expect` function which
provides some syntactic-sugar for defining simple expectations.

This is an alternative to the current approach of defining that `expect`
function on an ad-hoc basis.

I prefer this to adding `expect` to nixvim's lib because:
1. That would require having access to `lib`
2. IDK where in `lib` such a specialized function should live
2025-01-17 02:17:34 +00:00
Matt Sturgeon
5192a85f32
test/nixpkgs-module: use a fixed runCommand function
Rather than getting `runCommand` from the pkgs instance under test, get
the function from a fixed/consistent pkgs instance.
2025-01-16 02:55:01 +00:00
Matt Sturgeon
7854d5f18c
modules/test: fix expectations lib.toJSON -> builtins.toJSON 2025-01-16 02:55:00 +00:00
Sandro Jäckel
d608bccddd Replace runCommandNoCCLocal alias with runCommandLocal 2025-01-01 00:54:27 +00:00
Matt Sturgeon
fc9176c75b
modules/test: hide the deprecated check* options 2024-12-27 21:09:48 +00:00
Matt Sturgeon
e5974b316d
modules/test: document possible types for expectation value 2024-12-27 20:18:30 +00:00
Matt Sturgeon
ae612f8249
tests: use warning-expectations options
Deprecated the old `test.check*` options.
2024-12-27 18:31:34 +00:00
Matt Sturgeon
24e3b11b23
modules/test: allow specifying expectation value type 2024-12-27 18:31:34 +00:00
Matt Sturgeon
c2e172b0d3
modules/test: allow arbitrary warning/assertion expecations
Allow defining expectation predicates that will be tested on the final
warnings/assertions lists.
2024-12-27 18:31:34 +00:00
Matt Sturgeon
e7dcc9b518
modules/test: allow not building nixvim config 2024-12-27 11:33:53 +00:00
Matt Sturgeon
6a1bf6bdc3
modules/output: check warnings+assertions on build.package
Add a `build.packageUnchecked` option for use instead of the old `check`
evalNixvim argument.
2024-09-26 18:04:36 +01:00
Matt Sturgeon
692e39311e
modules/{output,files,test}: move outputs to build scope
Move the following output options into `build`:
- finalPackage -> package
- printInitPackage
- initPath -> initFile
- filesPlugin -> extraFiles
- test.derivation -> test
2024-09-26 06:31:57 +01:00
Matt Sturgeon
4814147442
modules/test: add config and options passthrus
This should make inspection of tests a little easier.
2024-08-28 00:08:10 +01:00
Matt Sturgeon
af31063538
modules/test: switch to runCommand 2024-08-28 00:08:10 +01:00
Matt Sturgeon
088e584e54
modules/test: check warnings/assertions
Warnings and assertions defined as `config.warnings` and `config.assertions`
respectively will be checked as part of the test derivation, instead of
when evaluating the modules.

Adds new `checkWarnings` and `checkAssertions` test options (default true).
2024-08-22 14:46:55 +01:00
Matt Sturgeon
38b09c1621
modules/test: remove docker dependency 2024-08-21 02:48:26 +01:00
Matt Sturgeon
cbd1003d9d
modules/test: move test derivation to an option
Introduced the `test.derivation` read-only option.
2024-08-21 02:48:00 +01:00
Matt Sturgeon
f47374fd26
modules/test: init, replacing dontRun arg
Introduces the `test.runNvim` module option.

Deprecates the historic `dontRun` argument passed to the test-derivation
helpers.

Soft-deprecates the `tests.dontRun` attr used in tests currently.
2024-08-20 00:34:12 +01:00