1# We assert that the new algorithmic way of generating these lists matches the
2# way they were hard-coded before.
3#
4# One might think "if we exhaustively test, what's the point of procedurally
5# calculating the lists anyway?". The answer is one can mindlessly update these
6# tests as new platforms become supported, and then just give the diff a quick
7# sanity check before committing :).
8let
9 lib = import ../default.nix;
10 mseteq = x: y: {
11 expr = lib.sort lib.lessThan x;
12 expected = lib.sort lib.lessThan y;
13 };
14in with lib.systems.doubles; lib.runTests {
15 all = assertTrue (mseteq all (linux ++ darwin ++ cygwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
16
17 arm = assertTrue (mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv7l-linux" ]);
18 i686 = assertTrue (mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" ]);
19 mips = assertTrue (mseteq mips [ "mipsel-linux" ]);
20 x86_64 = assertTrue (mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" ]);
21
22 cygwin = assertTrue (mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ]);
23 darwin = assertTrue (mseteq darwin [ "x86_64-darwin" ]);
24 freebsd = assertTrue (mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ]);
25 gnu = assertTrue (mseteq gnu (linux /* ++ hurd ++ kfreebsd ++ ... */));
26 illumos = assertTrue (mseteq illumos [ "x86_64-solaris" ]);
27 linux = assertTrue (mseteq linux [ "i686-linux" "x86_64-linux" "armv5tel-linux" "armv6l-linux" "armv7l-linux" "aarch64-linux" "mipsel-linux" ]);
28 netbsd = assertTrue (mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ]);
29 openbsd = assertTrue (mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ]);
30 unix = assertTrue (mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos));
31}