tests.testers.shellcheck: switch to testBuildFailure'
This commit is contained in:
@@ -4,41 +4,33 @@
|
||||
{
|
||||
lib,
|
||||
testers,
|
||||
runCommand,
|
||||
}:
|
||||
lib.recurseIntoAttrs {
|
||||
|
||||
example-dir =
|
||||
runCommand "test-testers-shellcheck-example-dir"
|
||||
{
|
||||
failure = testers.testBuildFailure (
|
||||
testers.shellcheck {
|
||||
name = "shellcheck-example-dir";
|
||||
src = ./src;
|
||||
}
|
||||
);
|
||||
}
|
||||
example-dir = testers.testBuildFailure' {
|
||||
drv = testers.shellcheck {
|
||||
name = "example-dir";
|
||||
src = ./src;
|
||||
};
|
||||
expectedBuilderExitCode = 123;
|
||||
expectedBuilderLogEntries = [
|
||||
''
|
||||
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 {
|
||||
name = "shellcheck-example-file";
|
||||
src = ./src/example.sh;
|
||||
}
|
||||
);
|
||||
}
|
||||
echo $@
|
||||
^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.
|
||||
''
|
||||
log="$failure/testBuildFailure.log"
|
||||
echo "Checking $log"
|
||||
grep SC2068 "$log"
|
||||
touch $out
|
||||
'';
|
||||
];
|
||||
};
|
||||
|
||||
example-file = testers.testBuildFailure' {
|
||||
drv = testers.shellcheck {
|
||||
name = "example-file";
|
||||
src = ./src/example.sh;
|
||||
};
|
||||
expectedBuilderExitCode = 123;
|
||||
expectedBuilderLogEntries = [
|
||||
''
|
||||
echo $@
|
||||
^-- SC2068 (error): Double quote array expansions to avoid re-splitting elements.
|
||||
''
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user