mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 13:57:36 +00:00
tests.coq.overrideCoqDerivation: add test
This commit is contained in:
parent
06ece659f0
commit
7efd4aa67c
6
pkgs/test/coq/default.nix
Normal file
6
pkgs/test/coq/default.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{ lib, callPackage }:
|
||||
|
||||
lib.recurseIntoAttrs {
|
||||
overrideCoqDerivation = callPackage ./overrideCoqDerivation { };
|
||||
}
|
||||
|
40
pkgs/test/coq/overrideCoqDerivation/default.nix
Normal file
40
pkgs/test/coq/overrideCoqDerivation/default.nix
Normal file
@ -0,0 +1,40 @@
|
||||
{ lib, coq, mkCoqPackages, runCommandNoCC }:
|
||||
|
||||
let
|
||||
|
||||
# This is just coq, but with dontFilter set to true. We need to set
|
||||
# dontFilter to true here so that _all_ packages are visibile in coqPackages.
|
||||
# There may be some versions of the top-level coq and coqPackages that don't
|
||||
# build QuickChick, which is what we are using for this test below.
|
||||
coqWithAllPackages = coq // { dontFilter = true; };
|
||||
|
||||
coqPackages = mkCoqPackages coqWithAllPackages;
|
||||
|
||||
# This is the main test. This uses overrideCoqDerivation to
|
||||
# override arguments to mkCoqDerivation.
|
||||
#
|
||||
# Here, we override the defaultVersion and release arguments to
|
||||
# mkCoqDerivation.
|
||||
overriddenQuickChick =
|
||||
coqPackages.lib.overrideCoqDerivation
|
||||
{
|
||||
defaultVersion = "9999";
|
||||
release."9999".sha256 = lib.fakeSha256;
|
||||
}
|
||||
coqPackages.QuickChick;
|
||||
in
|
||||
|
||||
runCommandNoCC
|
||||
"coq-overrideCoqDerivation-test-0.1"
|
||||
{ meta.maintainers = with lib.maintainers; [cdepillabout]; }
|
||||
''
|
||||
# Confirm that the computed version number for the overridden QuickChick does
|
||||
# actually become 9999, as set above.
|
||||
if [ "${overriddenQuickChick.version}" -eq "9999" ]; then
|
||||
echo "overriddenQuickChick version was successfully set to 9999"
|
||||
touch $out
|
||||
else
|
||||
echo "ERROR: overriddenQuickChick version was supposed to be 9999, but was actually: ${overriddenQuickChick.version}"
|
||||
exit 1
|
||||
fi
|
||||
''
|
@ -75,6 +75,8 @@ with pkgs;
|
||||
|
||||
dhall = callPackage ./dhall { };
|
||||
|
||||
coq = callPackage ./coq {};
|
||||
|
||||
makeWrapper = callPackage ./make-wrapper { };
|
||||
makeBinaryWrapper = callPackage ./make-binary-wrapper {
|
||||
makeBinaryWrapper = pkgs.makeBinaryWrapper.override {
|
||||
|
Loading…
Reference in New Issue
Block a user