2017-02-09 22:09:47 +01:00
|
|
|
# We assert that the new algorithmic way of generating these lists matches the
|
|
|
|
# way they were hard-coded before.
|
|
|
|
#
|
|
|
|
# One might think "if we exhaustively test, what's the point of procedurally
|
|
|
|
# calculating the lists anyway?". The answer is one can mindlessly update these
|
|
|
|
# tests as new platforms become supported, and then just give the diff a quick
|
|
|
|
# sanity check before committing :).
|
2017-04-25 02:12:43 +02:00
|
|
|
let
|
|
|
|
lib = import ../default.nix;
|
|
|
|
mseteq = x: y: {
|
|
|
|
expr = lib.sort lib.lessThan x;
|
|
|
|
expected = lib.sort lib.lessThan y;
|
|
|
|
};
|
|
|
|
in with lib.systems.doubles; lib.runTests {
|
2020-07-21 22:11:36 +02:00
|
|
|
testall = mseteq all (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ wasi ++ windows ++ embedded ++ js ++ genode ++ redox);
|
2017-02-09 22:09:47 +01:00
|
|
|
|
2020-03-18 22:43:11 +01:00
|
|
|
testarm = mseteq arm [ "armv5tel-linux" "armv6l-linux" "armv6l-none" "armv7a-linux" "armv7l-linux" "arm-none" "armv7a-darwin" ];
|
2019-07-10 20:38:55 +02:00
|
|
|
testi686 = mseteq i686 [ "i686-linux" "i686-freebsd" "i686-netbsd" "i686-openbsd" "i686-cygwin" "i686-windows" "i686-none" "i686-darwin" ];
|
2018-10-18 21:12:49 +02:00
|
|
|
testmips = mseteq mips [ "mipsel-linux" ];
|
2020-07-21 22:11:36 +02:00
|
|
|
testx86_64 = mseteq x86_64 [ "x86_64-linux" "x86_64-darwin" "x86_64-freebsd" "x86_64-genode" "x86_64-redox" "x86_64-openbsd" "x86_64-netbsd" "x86_64-cygwin" "x86_64-solaris" "x86_64-windows" "x86_64-none" ];
|
2017-02-09 22:09:47 +01:00
|
|
|
|
2018-10-18 21:12:49 +02:00
|
|
|
testcygwin = mseteq cygwin [ "i686-cygwin" "x86_64-cygwin" ];
|
2019-07-10 20:38:55 +02:00
|
|
|
testdarwin = mseteq darwin [ "x86_64-darwin" "i686-darwin" "aarch64-darwin" "armv7a-darwin" ];
|
2018-10-18 21:12:49 +02:00
|
|
|
testfreebsd = mseteq freebsd [ "i686-freebsd" "x86_64-freebsd" ];
|
2020-03-24 09:02:18 +01:00
|
|
|
testgenode = mseteq genode [ "aarch64-genode" "x86_64-genode" ];
|
2020-07-21 22:11:36 +02:00
|
|
|
testredox = mseteq redox [ "x86_64-redox" ];
|
2018-10-18 21:12:49 +02:00
|
|
|
testgnu = mseteq gnu (linux /* ++ kfreebsd ++ ... */);
|
|
|
|
testillumos = mseteq illumos [ "x86_64-solaris" ];
|
2019-10-01 18:51:57 +02:00
|
|
|
testlinux = mseteq linux [ "aarch64-linux" "armv5tel-linux" "armv6l-linux" "armv7a-linux" "armv7l-linux" "i686-linux" "mipsel-linux" "riscv32-linux" "riscv64-linux" "x86_64-linux" "powerpc64le-linux" ];
|
2018-10-18 21:12:49 +02:00
|
|
|
testnetbsd = mseteq netbsd [ "i686-netbsd" "x86_64-netbsd" ];
|
|
|
|
testopenbsd = mseteq openbsd [ "i686-openbsd" "x86_64-openbsd" ];
|
|
|
|
testwindows = mseteq windows [ "i686-cygwin" "x86_64-cygwin" "i686-windows" "x86_64-windows" ];
|
2020-07-21 22:11:36 +02:00
|
|
|
testunix = mseteq unix (linux ++ darwin ++ freebsd ++ openbsd ++ netbsd ++ illumos ++ cygwin ++ redox);
|
2017-02-09 22:09:47 +01:00
|
|
|
}
|