mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-30 17:43:42 +00:00
3fb14db08a
Needed for testing upcoming commit.
39 lines
830 B
Nix
39 lines
830 B
Nix
# Run:
|
|
# nix-build -A tests.testers.shellcheck
|
|
|
|
{ lib, testers, runCommand }:
|
|
let
|
|
inherit (lib) fileset;
|
|
in
|
|
lib.recurseIntoAttrs {
|
|
|
|
example-dir = runCommand "test-testers-shellcheck-example-dir" {
|
|
failure = testers.testBuildFailure
|
|
(testers.shellcheck {
|
|
src = fileset.toSource {
|
|
root = ./.;
|
|
fileset = fileset.unions [
|
|
./example.sh
|
|
];
|
|
};
|
|
});
|
|
} ''
|
|
log="$failure/testBuildFailure.log"
|
|
echo "Checking $log"
|
|
grep SC2068 "$log"
|
|
touch $out
|
|
'';
|
|
|
|
example-file = runCommand "test-testers-shellcheck-example-file" {
|
|
failure = testers.testBuildFailure
|
|
(testers.shellcheck {
|
|
src = ./example.sh;
|
|
});
|
|
} ''
|
|
log="$failure/testBuildFailure.log"
|
|
echo "Checking $log"
|
|
grep SC2068 "$log"
|
|
touch $out
|
|
'';
|
|
}
|