From f87e45d17e866f522a51b37dcb98f6415243a1aa Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Sat, 30 Oct 2021 23:13:06 -0300 Subject: ucg: mark as broken for ARM64 --- pkgs/tools/text/ucg/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkgs/tools/text') diff --git a/pkgs/tools/text/ucg/default.nix b/pkgs/tools/text/ucg/default.nix index d81b5a14f0914..26ad59fbb8e64 100644 --- a/pkgs/tools/text/ucg/default.nix +++ b/pkgs/tools/text/ucg/default.nix @@ -34,7 +34,9 @@ in stdenv.mkDerivation { license = licenses.gpl3Plus; maintainers = with maintainers; [ AndersonTorres ]; platforms = with platforms; unix; + broken = stdenv.isAarch64; # cpuid.h: no such file or directory }; passthru.tests = { inherit (nixosTests) ucg; }; } +# TODO: report upstream -- cgit 1.4.1 From dc4e3b543dd279674a767f222917dd64177f44b1 Mon Sep 17 00:00:00 2001 From: AndersonTorres Date: Fri, 29 Oct 2021 14:42:32 -0300 Subject: ucg: rewrite tests The tests can be easily done in the local machine, there is no necessity of starting a virtual machine for them. --- nixos/tests/all-tests.nix | 3 +-- nixos/tests/ucg.nix | 18 ------------------ pkgs/tools/text/ucg/default.nix | 34 +++++++++++++++++++++++++--------- 3 files changed, 26 insertions(+), 29 deletions(-) delete mode 100644 nixos/tests/ucg.nix (limited to 'pkgs/tools/text') diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index 1f91d5b4f3811..d8bee3eeeb766 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -453,8 +453,8 @@ in tinc = handleTest ./tinc {}; tinydns = handleTest ./tinydns.nix {}; tor = handleTest ./tor.nix {}; - # traefik test relies on docker-containers trac = handleTest ./trac.nix {}; + # traefik test relies on docker-containers traefik = handleTestOn ["x86_64-linux"] ./traefik.nix {}; trafficserver = handleTest ./trafficserver.nix {}; transmission = handleTest ./transmission.nix {}; @@ -466,7 +466,6 @@ in turbovnc-headless-server = handleTest ./turbovnc-headless-server.nix {}; tuxguitar = handleTest ./tuxguitar.nix {}; ucarp = handleTest ./ucarp.nix {}; - ucg = handleTest ./ucg.nix {}; udisks2 = handleTest ./udisks2.nix {}; unbound = handleTest ./unbound.nix {}; unit-php = handleTest ./web-servers/unit-php.nix {}; diff --git a/nixos/tests/ucg.nix b/nixos/tests/ucg.nix deleted file mode 100644 index 7769fd01fce42..0000000000000 --- a/nixos/tests/ucg.nix +++ /dev/null @@ -1,18 +0,0 @@ -import ./make-test-python.nix ({ pkgs, ... }: { - name = "ucg"; - meta = with pkgs.lib.maintainers; { - maintainers = [ AndersonTorres ]; - }; - - machine = { pkgs, ... }: { - environment.systemPackages = [ pkgs.ucg ]; - }; - - testScript = '' - machine.succeed("echo 'Lorem ipsum dolor sit amet\n2.7182818284590' > /tmp/foo") - assert "dolor" in machine.succeed("ucg 'dolor' /tmp/foo") - assert "Lorem" in machine.succeed("ucg --ignore-case 'lorem' /tmp/foo") - machine.fail("ucg --word-regexp '2718' /tmp/foo") - machine.fail("ucg 'pisum' /tmp/foo") - ''; -}) diff --git a/pkgs/tools/text/ucg/default.nix b/pkgs/tools/text/ucg/default.nix index 26ad59fbb8e64..d19379477d6ca 100644 --- a/pkgs/tools/text/ucg/default.nix +++ b/pkgs/tools/text/ucg/default.nix @@ -3,14 +3,11 @@ , pkg-config , autoreconfHook , pcre -, nixosTests }: -let +stdenv.mkDerivation rec { pname = "ucg"; - version = "20190225"; -in stdenv.mkDerivation { - inherit pname version; + version = "0.3.3+date=2019-02-25"; src = fetchFromGitHub { owner = "gvansickle"; @@ -19,8 +16,29 @@ in stdenv.mkDerivation { sha256 = "sha256-/wU1PmI4ejlv7gZzZNasgROYXFiDiIxE9BFoCo6+G5Y="; }; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ pcre ]; + nativeBuildInputs = [ + autoreconfHook + pkg-config + ]; + + buildInputs = [ + pcre + ]; + + doInstallCheck = true; + installCheckPhase = '' + runHook preInstallCheck + + testFile=$(mktemp /tmp/ucg-test.XXXX) + echo -ne 'Lorem ipsum dolor sit amet\n2.7182818284590' > $testFile + $out/bin/ucg 'dolor' $testFile || { rm $testFile; exit -1; } + $out/bin/ucg --ignore-case 'lorem' $testFile || { rm $testFile; exit -1; } + $out/bin/ucg --word-regexp '2718' $testFile && { rm $testFile; exit -1; } + $out/bin/ucg 'pisum' $testFile && { rm $testFile; exit -1; } + rm $testFile + + runHook postInstallCheck + ''; meta = with lib; { homepage = "https://github.com/gvansickle/ucg/"; @@ -36,7 +54,5 @@ in stdenv.mkDerivation { platforms = with platforms; unix; broken = stdenv.isAarch64; # cpuid.h: no such file or directory }; - - passthru.tests = { inherit (nixosTests) ucg; }; } # TODO: report upstream -- cgit 1.4.1