openvswitch: generalize builder
[NixPkgs.git] / lib / tests / systems.nix
blob27c5ff565ca04725a7611292f49bbeb46b1b688b
1 # We assert that the new algorithmic way of generating these lists matches the
2 # way they were hard-coded before.
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 :).
8 let
9   lib = import ../default.nix;
10   mseteq = x: y: {
11     expr     = lib.sort lib.lessThan x;
12     expected = lib.sort lib.lessThan y;
13   };
15 with lib.systems.doubles; lib.runTests {
16   testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ mmix ++ js ++ genode ++ redox);
18   testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-netbsd" "armv6l-none" "armv7a-linux" "armv7a-netbsd" "armv7l-linux" "armv7l-netbsd" "arm-none" "armv7a-darwin" ];
19   testi686 = mseteq i686 [ "i686-linux" "i686-freebsd13" "i686-genode" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
20   testmips = mseteq mips [ "mips64el-linux" "mipsel-linux" "mipsel-netbsd" ];
21   testmmix = mseteq mmix [ "mmix-mmixware" ];
22   testriscv = mseteq riscv [ "riscv32-linux" "riscv64-linux" "riscv32-netbsd" "riscv64-netbsd" "riscv32-none" "riscv64-none" ];
23   testriscv32 = mseteq riscv32 [ "riscv32-linux" "riscv32-netbsd" "riscv32-none" ];
24   testriscv64 = mseteq riscv64 [ "riscv64-linux" "riscv64-netbsd" "riscv64-none" ];
25   testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd13" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
27   testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
28   testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
29   testfreebsd = mseteq freebsd [ "i686-freebsd13" "x86_64-freebsd13" ];
30   testgenode = mseteq genode [ "aarch64-genode" "i686-genode" "x86_64-genode" ];
31   testredox = mseteq redox [ "x86_64-redox" ];
32   testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
33   testillumos = mseteq illumos [ "x86_64-solaris" ];
34   testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mips64el-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64-linux" "powerpc64le-linux" "m68k-linux" "s390-linux" "s390x-linux" "microblaze-linux" "microblazeel-linux" ];
35   testnetbsd = mseteq netbsd [ "aarch64-netbsd" "armv6l-netbsd" "armv7a-netbsd" "armv7l-netbsd" "i686-netbsd" "m68k-netbsd" "mipsel-netbsd" "powerpc-netbsd" "riscv32-netbsd" "riscv64-netbsd" "x86_64-netbsd" ];
36   testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ];
37   testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
38   testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox);