Commit graph

20 commits

Author SHA1 Message Date
Stanislav Asunkin
ddddd780e0
tests/fetch-tests: avoid unnecessary copy-to-store
Previously path was concatenated using string interpolation. This commit
switches from string interpolation to path interpolation.

The problem is nix will copy the "${directory}" to a new store
object, meaning anything outside its root won't be available.

From the nix manual:

> A path in an interpolated expression is first copied into the Nix
> store, and the resulting string is the store path of the newly created
> store object.

https://nix.dev/manual/nix/2.28/language/string-interpolation#interpolated-expression
2025-05-12 15:24:52 +01:00
Matt Sturgeon
e679ee91fa
tests: omit default suffix in test names
If the test file is `default.nix`, we don't need to append the filename
to the test namespace.
2024-12-27 19:13:05 +00:00
Matt Sturgeon
ce4c3a72c1
tests/fetch-test: tweak signature 2024-09-07 22:29:43 +01:00
Matt Sturgeon
975af6a498
tests: simplify fetch-tests slightly
Simplify by reducing the number of transformations done to the
test-files' test-case modules attr.

Since `pkgs.linkFarm` can accept _either_ a list or an attrset, we don't
need to transform the attrset into a list.
2024-08-28 05:45:01 +01:00
Matt Sturgeon
fe12a092f6
tests: general cleanup
- Refactor much of `tests/fetch-tests.nix`
- Move `mkTest` up to let-block in `tests/default.nix`
2024-08-22 15:27:56 +01:00
Matt Sturgeon
087f70cb0a
tests: remove special case for efmls-configs 2024-08-22 15:27:56 +01:00
Matt Sturgeon
123a55ed6f
tests: remove special treatment of module
Since we no longer need to extract `tests.dontRun` from an attrset, we
no longer need the "special" `module` attr.
2024-08-20 01:07:21 +01:00
Stanislav Asunkin
44849233e0 modules/performance: add ability to byte compile lua configuration files
This commit adds support for byte compiling lua configuration files.
It's enabled by default (if byte compiling is enabled at all) and can be
disabled with `performance.byteCompileLua.configs` toggle.

To implement this feature `extraFiles.<name>.finalSource` internal
read-only option is introduced. `source` option cannot be used because
it's user configurable. In order to access the values of the
`performance.byteCompileLua` options, parent config is added to
specialArgs of extraFiles submodule. Then the usages of `source` option
changed to `finalSource` in all relevant places (filesPlugin and
wrappers).

Added more helpers for various cases of byte compiling:

* `byteCompileLuaFile` byte compiles lua file
* `byteCompileLuaHook` is a setup hook that byte compiles all lua files
* `byteCompileLuaDrv` overrides derivation by adding byteCompileLuaHook
  to it

Added tests to validate that extraFiles specified by various methods are
handled correctly. Added a separate home-manager test, that is intended
to validate that extraFiles propagated to wrapper modules are correctly
byte compiled.
2024-07-31 11:31:40 +00:00
traxys
50d865275d tests: Reduce the number of calls to mkTestDerivationFromNixvimModule 2024-07-19 11:11:17 +02:00
Matt Sturgeon
d8f3113e90
plugins/none-ls: refactor using mkSourcePlugin
Introduce `_mk-source-plugin.nix`, which returns a module handling a
specific none-ls source plugin.

This wasn't possible previously due to IFD conflicting with evaluating
module imports.

Adjusted the test to use the `options` provided via module args, and
cleaned up some stuff allowing "unpackaged" sources to not be listed
again in the test file.
2024-07-13 20:11:09 +01:00
Matt Sturgeon
3a8d4fee35
plugins/cmp: refactor source->plugin association
Introduce the internal option `cmpSourcePlugins` where plugins can
register their nvim-cmp source name association.
2024-06-30 18:22:59 +01:00
traxys
62f32bfc71 treewide: Reformat with nixfmt 2024-05-05 22:00:40 +02:00
Gaetan Lepage
91e3bb0523 tests/cmp: add a test that enables all sources 2024-04-30 13:32:00 +02:00
Loïc Reynier
233feeb8d2
treewide: fix typos (#1217) 2024-03-07 19:44:13 +01:00
traxys
f9280a6865
plugin/none-ls: Implement all builtins (#1169)
* plugins/none-ls: Use upstream builtins.json to list sources

This avoids the need to define sources in nixvim. We only need to define
a mapping from source names to packages.

This commit does not yet introduce sources for the newly available builtins

* plugin/none-ls: Enable all known sources in tests

* plugins/none-ls: Add all missing sources
2024-03-01 13:24:14 +01:00
Gaetan Lepage
a121d96091 tests: do not import helpers.nix directly 2024-02-11 11:50:35 +01:00
traxys
1b44fe37a1
tests: Install all efmls-configs tools (#709)
This requires to pass the efmls-configs file to the derivation helpers,
if we try to import it from the test file directly it fails.

We then look into the types to find the available languages &
corresponding tools, to enable them all.

We then filter out the broken tools or the unpackaged tools, in order to
detect more easily the introduction of future tools.
2023-11-17 12:17:13 +01:00
Gaetan Lepage
9e448b7ff0 tests: allow test cases to use the nixvim helpers (for testing them) 2023-09-27 10:48:13 +02:00
Tanish2002
efdcbe225f perform some statix linting and fixes 2023-05-22 23:00:53 +02:00
Gaétan Lepage
db5061b4db
tests/plugins: refactor (#235) 2023-03-22 07:42:02 +01:00