···
-
import ./make-test-python.nix (
-
machineNames = builtins.map machineSafe manImplementations;
-
makeConfig = useImpl: {
-
# Note: mandoc currently can't index symlinked section directories.
-
# So if a man section comes from one package exclusively (e. g.
-
# 1p from man-pages-posix and 2 from man-pages), it isn't searchable.
-
environment.systemPackages = [
-
nixos.enable = lib.mkForce true;
-
enable = useImpl == impl;
-
machineSafe = builtins.replaceStrings [ "-" ] [ "_" ];
-
meta.maintainers = [ lib.maintainers.sternenseemann ];
-
nodes = lib.listToAttrs (
-
def match_man_k(page, section, haystack):
-
Check if the man page {page}({section}) occurs in
-
the output of `man -k` given as haystack. Note:
-
This is not super reliable, e. g. it can't deal
-
with man pages that are in multiple sections.
-
for line in haystack.split("\n"):
-
# man -k can look like this:
-
# pagea, pageb (3, 3P) - foo
-
# pagea, pageb, pagec(3) - bar
-
pages = line.split("(")[0]
-
sections = re.search("\\([a-zA-Z1-9, ]+\\)", line)
-
sections = sections.group(0)[1:-1]
-
if page in pages and f'{section}' in sections:
-
+ lib.concatMapStrings (machine: ''
-
with subtest("Test direct man page lookups in ${machine}"):
-
${machine}.succeed("man man > /dev/null")
-
${machine}.succeed("man 3 libunwind > /dev/null")
-
# NixOS configuration man page is installed
-
${machine}.succeed("man configuration.nix > /dev/null")
-
with subtest("Test generateCaches via man -k in ${machine}"):
-
("unwind", "libunwind", 3),
-
("user", "useradd", 8),
-
("user", "userdel", 8),
-
for (keyword, page, section) in expected:
-
matches = ${machine}.succeed(f"man -k {keyword}")
-
if not match_man_k(page, section, matches):
-
raise Exception(f"{page}({section}) missing in matches: {matches}")
···
+
machineNames = builtins.map machineSafe manImplementations;
+
makeConfig = useImpl: {
+
# Note: mandoc currently can't index symlinked section directories.
+
# So if a man section comes from one package exclusively (e. g.
+
# 1p from man-pages-posix and 2 from man-pages), it isn't searchable.
+
environment.systemPackages = [
+
nixos.enable = lib.mkForce true;
+
enable = useImpl == impl;
+
machineSafe = builtins.replaceStrings [ "-" ] [ "_" ];
+
meta.maintainers = [ lib.maintainers.sternenseemann ];
+
nodes = lib.listToAttrs (
+
def match_man_k(page, section, haystack):
+
Check if the man page {page}({section}) occurs in
+
the output of `man -k` given as haystack. Note:
+
This is not super reliable, e. g. it can't deal
+
with man pages that are in multiple sections.
+
for line in haystack.split("\n"):
+
# man -k can look like this:
+
# pagea, pageb (3, 3P) - foo
+
# pagea, pageb, pagec(3) - bar
+
pages = line.split("(")[0]
+
sections = re.search("\\([a-zA-Z1-9, ]+\\)", line)
+
sections = sections.group(0)[1:-1]
+
if page in pages and f'{section}' in sections:
+
+ lib.concatMapStrings (machine: ''
+
with subtest("Test direct man page lookups in ${machine}"):
+
${machine}.succeed("man man > /dev/null")
+
${machine}.succeed("man 3 libunwind > /dev/null")
+
# NixOS configuration man page is installed
+
${machine}.succeed("man configuration.nix > /dev/null")
+
with subtest("Test generateCaches via man -k in ${machine}"):
+
("unwind", "libunwind", 3),
+
("user", "useradd", 8),
+
("user", "userdel", 8),
+
for (keyword, page, section) in expected:
+
matches = ${machine}.succeed(f"man -k {keyword}")
+
if not match_man_k(page, section, matches):
+
raise Exception(f"{page}({section}) missing in matches: {matches}")