Skip to content

Commit

Permalink
README: add development session
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Jul 24, 2024
1 parent b462f1e commit 3b6c1ce
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,41 @@ library.

- [Events](https://wiki.hyprland.org/Plugins/Development/Event-list/)

## Development

If you are developing inside a Hyprland session, and have Go installed, you can
simply run:

```console
# -short flag recommended otherwise this will run some possibly dangerous tests
go test -short -v
```

Keep in mind that this will probably mess your current session. We will reload
your configuration at the end, but any dynamic configuration will be lost.

We also have tests running in CI based in a [NixOS](https://nixos.org/) VM
using [`nixosTests`](https://wiki.nixos.org/wiki/NixOS_VM_tests). Check the
[`flake.nix`](./flake.nix) file. This will automatically start a VM running
Hyprland and run the Go tests inside it.

To run the NixOS tests locally, install [Nix](https://nixos.org/download/) in
any Linux system and run:

```console
nix --experimental-features 'nix-command flakes' flake check -L
```

If you want to debug tests, it is possible to run the VM in interactive mode by
running:

```console
nix --experimental-features 'nix-command flakes' build .#checks.x86-64_linux.testVm.driverInteractive
./result
```

And you can run `start_all()` to start the VM.

## Credits

- [hyprland-ipc-client](https://github.com/labi-le/hyprland-ipc-client) for
Expand Down

0 comments on commit 3b6c1ce

Please sign in to comment.