From 1add3c3a99ce2c2486cf524c2b42677787916a9e Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 29 Jun 2023 04:07:31 +0100 Subject: [PATCH] manual: add test This checks that the documentation can be built in the context of a Home Manager configuration. --- tests/default.nix | 3 ++- tests/modules/misc/manual/default.nix | 1 + tests/modules/misc/manual/manual.nix | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 tests/modules/misc/manual/default.nix create mode 100644 tests/modules/misc/manual/manual.nix diff --git a/tests/default.nix b/tests/default.nix index 890264030..5b6cbcb2f 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -30,7 +30,7 @@ let # Avoid including documentation since this will cause # unnecessary rebuilds of the tests. - manual.manpages.enable = false; + manual.manpages.enable = lib.mkDefault false; imports = [ ./asserts.nix ./big-test.nix ./stubs.nix ]; @@ -52,6 +52,7 @@ import nmt { ./modules/files ./modules/home-environment ./modules/misc/fontconfig + ./modules/misc/manual ./modules/misc/nix ./modules/misc/specialisation ./modules/programs/aerc diff --git a/tests/modules/misc/manual/default.nix b/tests/modules/misc/manual/default.nix new file mode 100644 index 000000000..095809c91 --- /dev/null +++ b/tests/modules/misc/manual/default.nix @@ -0,0 +1 @@ +{ manual = ./manual.nix; } diff --git a/tests/modules/misc/manual/manual.nix b/tests/modules/misc/manual/manual.nix new file mode 100644 index 000000000..eb70374a3 --- /dev/null +++ b/tests/modules/misc/manual/manual.nix @@ -0,0 +1,19 @@ +{ ... }: + +{ + config = { + manual = { + html.enable = true; + manpages.enable = true; + json.enable = true; + }; + + nmt.script = '' + assertFileExists home-path/share/doc/home-manager/index.html + assertFileExists home-path/share/doc/home-manager/options.html + assertFileExists home-path/share/doc/home-manager/options.json + assertFileExists home-path/share/man/man1/home-manager.1.gz + assertFileExists home-path/share/man/man5/home-configuration.nix.5.gz + ''; + }; +}