mirror of
https://github.com/numtide/flake-utils.git
synced 2024-12-14 11:47:31 +00:00
check-utils: use the same success derivation (#75)
A successful check doesn't need reporting, so we use the same derivation to reduce building jobs.
This commit is contained in:
parent
bee6a7250d
commit
7e2a3b3dfd
1 changed files with 4 additions and 2 deletions
|
@ -34,16 +34,18 @@ let
|
|||
builder = "/bin/sh";
|
||||
args = [ "-c" command ];
|
||||
};
|
||||
|
||||
success = test "SUCCESS" "echo success > $out";
|
||||
in
|
||||
{
|
||||
|
||||
isEqual = a: b:
|
||||
if a == b
|
||||
then test "SUCCESS__${str a}__IS_EQUAL__${str b}" "echo success > $out"
|
||||
then success
|
||||
else test "FAILURE__${str a}__NOT_EQUAL__${str b}" "exit 1";
|
||||
|
||||
hasKey = attrset: key:
|
||||
if attrset ? ${str key}
|
||||
then test "SUCCESS__${str key}__EXISTS_IN_ATTRSET" "echo success > $out"
|
||||
then success
|
||||
else test "FAILURE__${str key}__DOES_NOT_EXISTS_IN_ATTRSET_SIZE_${str(length (attrNames attrset))}" "exit 1";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue