mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
pkgs/test: fix silent failures when using runTests
This commit is contained in:
parent
fc6e6b8ffb
commit
2951758f51
@ -1,6 +1,3 @@
|
||||
# to run these tests:
|
||||
# nix-instantiate --eval --strict . -A tests.kernel-config
|
||||
#
|
||||
# make sure to use NON EXISTING kernel settings else they may conflict with
|
||||
# common-config.nix
|
||||
{ lib, pkgs }:
|
||||
@ -37,8 +34,7 @@ let
|
||||
{ NIXOS_FAKE_USB_DEBUG = option yes;}
|
||||
];
|
||||
|
||||
in
|
||||
runTests {
|
||||
failures = runTests {
|
||||
testEasy = {
|
||||
expr = (getConfig { NIXOS_FAKE_USB_DEBUG = yes;}).NIXOS_FAKE_USB_DEBUG;
|
||||
expected = { tristate = "y"; optional = false; freeform = null; };
|
||||
@ -70,4 +66,8 @@ runTests {
|
||||
expected = false;
|
||||
};
|
||||
|
||||
}
|
||||
};
|
||||
in
|
||||
|
||||
lib.optional (failures != [])
|
||||
(throw "The following kernel unit tests failed: ${lib.generators.toPretty {} failures}")
|
||||
|
@ -1,6 +1,7 @@
|
||||
{ pkgs, lib, stdenv, ... }:
|
||||
|
||||
lib.runTests {
|
||||
let
|
||||
failures = lib.runTests {
|
||||
# Merging two non-list definitions must still result in an error
|
||||
# about a conflicting definition.
|
||||
test-unitOption-merging-non-lists-conflict =
|
||||
@ -34,4 +35,8 @@ lib.runTests {
|
||||
expr = nixos.config.systemd.services.systemd-test-nixos.serviceConfig.StateDirectory;
|
||||
expected = [ "foo" "bar" ];
|
||||
};
|
||||
}
|
||||
};
|
||||
in
|
||||
|
||||
lib.optional (failures != [])
|
||||
(throw "The following systemd unit tests failed: ${lib.generators.toPretty {} failures}")
|
||||
|
Loading…
Reference in New Issue
Block a user