spigot: add a simple test
This commit is contained in:
parent
5ff9d48070
commit
822dd9b460
2 changed files with 28 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, fetchurl
|
, fetchurl
|
||||||
|
, callPackage
|
||||||
, cmake
|
, cmake
|
||||||
, gmp
|
, gmp
|
||||||
, halibut
|
, halibut
|
||||||
|
@ -32,6 +33,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
|
passthru.tests = {
|
||||||
|
approximation = callPackage ./tests/approximation.nix {
|
||||||
|
spigot = finalAttrs.finalPackage;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://www.chiark.greenend.org.uk/~sgtatham/spigot/";
|
homepage = "https://www.chiark.greenend.org.uk/~sgtatham/spigot/";
|
||||||
description = "A command-line exact real calculator";
|
description = "A command-line exact real calculator";
|
||||||
|
|
21
pkgs/by-name/sp/spigot/tests/approximation.nix
Normal file
21
pkgs/by-name/sp/spigot/tests/approximation.nix
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
{ lib
|
||||||
|
, stdenv
|
||||||
|
, spigot
|
||||||
|
}:
|
||||||
|
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "spigot-approximation";
|
||||||
|
inherit (spigot) version;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ spigot ];
|
||||||
|
|
||||||
|
dontInstall = true;
|
||||||
|
|
||||||
|
buildCommand = ''
|
||||||
|
[ "$(spigot -b2 -d32 '(pi/1-355/113)')" = "-0.00000000000000000000010001111001" ]
|
||||||
|
[ "$(spigot -b2 -d32 '(e/1-1457/536)')" = "-0.00000000000000000001110101101011" ]
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta.timeout = 10;
|
||||||
|
}
|
Loading…
Reference in a new issue