mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 19:17:35 +00:00
Merge pull request #143768 from iAmMrinal0/remove/batTest
bat: move nixos test to installCheckPhase
This commit is contained in:
commit
bd2411b1d7
@ -34,7 +34,6 @@ in
|
||||
avahi-with-resolved = handleTest ./avahi.nix { networkd = true; };
|
||||
awscli = handleTest ./awscli.nix { };
|
||||
babeld = handleTest ./babeld.nix {};
|
||||
bat = handleTest ./bat.nix {};
|
||||
bazarr = handleTest ./bazarr.nix {};
|
||||
bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64
|
||||
beanstalkd = handleTest ./beanstalkd.nix {};
|
||||
|
@ -1,12 +0,0 @@
|
||||
import ./make-test-python.nix ({ pkgs, ... }: {
|
||||
name = "bat";
|
||||
meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; };
|
||||
|
||||
machine = { pkgs, ... }: { environment.systemPackages = [ pkgs.bat ]; };
|
||||
|
||||
testScript = ''
|
||||
machine.succeed("echo 'Foobar\n\n\n42' > /tmp/foo")
|
||||
assert "Foobar" in machine.succeed("bat -p /tmp/foo")
|
||||
assert "42" in machine.succeed("bat -p /tmp/foo -r 4:4")
|
||||
'';
|
||||
})
|
@ -1,6 +1,5 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, nixosTests
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
, pkg-config
|
||||
@ -41,7 +40,18 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
checkFlags = [ "--skip=pager_more" "--skip=pager_most" ];
|
||||
|
||||
passthru.tests = { inherit (nixosTests) bat; };
|
||||
doInstallCheck = true;
|
||||
installCheckPhase = ''
|
||||
runHook preInstallCheck
|
||||
|
||||
testFile=$(mktemp /tmp/bat-test.XXXX)
|
||||
echo -ne 'Foobar\n\n\n42' > $testFile
|
||||
$out/bin/bat -p $testFile | grep "Foobar"
|
||||
$out/bin/bat -p $testFile -r 4:4 | grep 42
|
||||
rm $testFile
|
||||
|
||||
runHook postInstallCheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "A cat(1) clone with syntax highlighting and Git integration";
|
||||
|
Loading…
Reference in New Issue
Block a user