mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-20 04:19:00 +02:00
cue: move custom installCheckPhase to passthru.tests
As recommended by the Nixpkgs documentation, custom tests are better served by passthru.tests, whilst installCheckPhase is recommended for tests that come from the upstream.
This commit is contained in:
parent
90d9ce0e26
commit
1861d88ec8
|
@ -27,21 +27,16 @@ buildGoModule rec {
|
|||
ldflags = [ "-s" "-w" "-X cuelang.org/go/cmd/cue/cmd.version=${version}" ];
|
||||
|
||||
postInstall = ''
|
||||
# Completions
|
||||
installShellCompletion --cmd cue \
|
||||
--bash <($out/bin/cue completion bash) \
|
||||
--fish <($out/bin/cue completion fish) \
|
||||
--zsh <($out/bin/cue completion zsh)
|
||||
'';
|
||||
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
$out/bin/cue eval - <<<'a: "all good"' > /dev/null
|
||||
'';
|
||||
|
||||
passthru = {
|
||||
writeCueValidator = callPackage ./validator.nix { };
|
||||
tests = {
|
||||
test-001-all-good = callPackage ./tests/001-all-good.nix { };
|
||||
version = testers.testVersion {
|
||||
package = cue;
|
||||
command = "cue version";
|
||||
|
|
11
pkgs/development/tools/cue/tests/001-all-good.nix
Normal file
11
pkgs/development/tools/cue/tests/001-all-good.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
{ lib
|
||||
, cue
|
||||
, runCommand
|
||||
}:
|
||||
|
||||
runCommand "cue-test-001-all-good-${cue.version}" {
|
||||
nativeBuildInputs = [ cue ];
|
||||
meta.timeout = 10;
|
||||
} ''
|
||||
cue eval - <<<'a: "all good"' > $out
|
||||
''
|
Loading…
Reference in a new issue