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:
@@ -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";
|
||||
|
||||
@@ -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
|
||||
''
|
||||
Reference in New Issue
Block a user