Merge pull request #143768 from iAmMrinal0/remove/batTest

bat: move nixos test to installCheckPhase

authored by Maximilian Bosch and committed by GitHub bd2411b1 f0685040

+12 -15
-1
nixos/tests/all-tests.nix
··· 34 34 avahi-with-resolved = handleTest ./avahi.nix { networkd = true; }; 35 35 awscli = handleTest ./awscli.nix { }; 36 36 babeld = handleTest ./babeld.nix {}; 37 - bat = handleTest ./bat.nix {}; 38 37 bazarr = handleTest ./bazarr.nix {}; 39 38 bcachefs = handleTestOn ["x86_64-linux"] ./bcachefs.nix {}; # linux-4.18.2018.10.12 is unsupported on aarch64 40 39 beanstalkd = handleTest ./beanstalkd.nix {};
-12
nixos/tests/bat.nix
··· 1 - import ./make-test-python.nix ({ pkgs, ... }: { 2 - name = "bat"; 3 - meta = with pkgs.lib.maintainers; { maintainers = [ nequissimus ]; }; 4 - 5 - machine = { pkgs, ... }: { environment.systemPackages = [ pkgs.bat ]; }; 6 - 7 - testScript = '' 8 - machine.succeed("echo 'Foobar\n\n\n42' > /tmp/foo") 9 - assert "Foobar" in machine.succeed("bat -p /tmp/foo") 10 - assert "42" in machine.succeed("bat -p /tmp/foo -r 4:4") 11 - ''; 12 - })
+12 -2
pkgs/tools/misc/bat/default.nix
··· 1 1 { lib 2 2 , stdenv 3 - , nixosTests 4 3 , rustPlatform 5 4 , fetchFromGitHub 6 5 , pkg-config ··· 41 40 42 41 checkFlags = [ "--skip=pager_more" "--skip=pager_most" ]; 43 42 44 - passthru.tests = { inherit (nixosTests) bat; }; 43 + doInstallCheck = true; 44 + installCheckPhase = '' 45 + runHook preInstallCheck 46 + 47 + testFile=$(mktemp /tmp/bat-test.XXXX) 48 + echo -ne 'Foobar\n\n\n42' > $testFile 49 + $out/bin/bat -p $testFile | grep "Foobar" 50 + $out/bin/bat -p $testFile -r 4:4 | grep 42 51 + rm $testFile 52 + 53 + runHook postInstallCheck 54 + ''; 45 55 46 56 meta = with lib; { 47 57 description = "A cat(1) clone with syntax highlighting and Git integration";