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:
Anderson Torres 2024-03-29 15:43:10 -03:00
parent 90d9ce0e26
commit 1861d88ec8
2 changed files with 12 additions and 6 deletions

View file

@ -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";

View 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
''