mirror of
https://github.com/numtide/flake-utils.git
synced 2024-08-17 16:10:28 +03: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
@ -34,16 +34,18 @@ let
|
|||||||
builder = "/bin/sh";
|
builder = "/bin/sh";
|
||||||
args = [ "-c" command ];
|
args = [ "-c" command ];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
success = test "SUCCESS" "echo success > $out";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
|
||||||
isEqual = a: b:
|
isEqual = a: b:
|
||||||
if 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";
|
else test "FAILURE__${str a}__NOT_EQUAL__${str b}" "exit 1";
|
||||||
|
|
||||||
hasKey = attrset: key:
|
hasKey = attrset: key:
|
||||||
if attrset ? ${str 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";
|
else test "FAILURE__${str key}__DOES_NOT_EXISTS_IN_ATTRSET_SIZE_${str(length (attrNames attrset))}" "exit 1";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user