mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 03:44:07 +01:00
shellspec.tests: init
This commit is contained in:
parent
5e780ea336
commit
f3c573a4dc
1 changed files with 25 additions and 1 deletions
|
|
@ -3,6 +3,11 @@
|
|||
stdenv,
|
||||
fetchFromGitHub,
|
||||
bash,
|
||||
|
||||
# Test-only
|
||||
dash,
|
||||
ksh,
|
||||
zsh,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
|
|
@ -22,12 +27,31 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
checkPhase = ''
|
||||
./shellspec --no-banner --task fixture:stat:prepare
|
||||
./shellspec --no-banner spec --jobs "$(nproc)"
|
||||
./shellspec --no-banner spec --jobs "$(nproc)" ${finalAttrs.extraTestArgs or ""}
|
||||
'';
|
||||
|
||||
# "Building" the script happens in Docker
|
||||
dontBuild = true;
|
||||
|
||||
passthru.tests =
|
||||
let
|
||||
# Tests are not enabled by default, so enable them.
|
||||
enabled = finalAttrs.overrideAttrs { doCheck = true; };
|
||||
# For adding variations. Use testWith (finalAttrs: prevAttrs: { }) if needed.
|
||||
testWith = enabled.overrideAttrs;
|
||||
in
|
||||
{
|
||||
# Enable tests in all variations
|
||||
# Some of these may log failures, which are later treated as SKIPPED.
|
||||
# This is normal. Look for "0 failures" and a successful derivation build.
|
||||
with-bin-sh = enabled;
|
||||
with-bash = testWith { extraTestArgs = "--shell ${lib.getExe bash}"; };
|
||||
# with-dash: Broken as of shellspec 0.28.1, dash 0.5.13.1
|
||||
# with-dash = testWith { extraTestArgs = "--shell ${lib.getExe dash}"; };
|
||||
with-ksh = testWith { extraTestArgs = "--shell ${lib.getExe ksh}"; };
|
||||
with-zsh = testWith { extraTestArgs = "--shell ${lib.getExe zsh}"; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Full-featured BDD unit testing framework for bash, ksh, zsh, dash and all POSIX shells";
|
||||
homepage = "https://shellspec.info/";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue