Unverified Commit 72b9dddb authored by 7c6f434c's avatar 7c6f434c Committed by GitHub
Browse files

gfan: disable hardening, enable tests (#511262)

parents 5d60c302 acc5ae74
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -35,7 +35,14 @@ stdenv.mkDerivation (finalAttrs: {
    })
  ];

  postPatch = lib.optionalString stdenv.cc.isClang ''
  # This test assumes that our implementation of sort behaves identically to the
  # one used during development, which is not necessarily the case; update the
  # expected result to be sorted using our copy of sort.
  postPatch = ''
    sort testsuite/0008PolynomialSetUnion/output -o testsuite/0008PolynomialSetUnion/output
    sort testsuite/0008PolynomialSetUnion/outputNew -o testsuite/0008PolynomialSetUnion/outputNew
  ''
  + lib.optionalString stdenv.cc.isClang ''
    substituteInPlace Makefile --replace "-fno-guess-branch-probability" ""

    for f in $(find -name "*.h" -or -name "*.cpp"); do
@@ -53,6 +60,15 @@ stdenv.mkDerivation (finalAttrs: {
    mpir
    cddlib
  ];
  hardeningDisable = [ "libcxxhardeningfast" ];

  doCheck = true;
  # The test runner still exits successfully when there are failed tests, so check
  # stdout to see if anything failed.
  checkPhase = ''
    make check | tee "$TMPDIR/test.log"
    ! grep -q "Failed tests:" "$TMPDIR/test.log"
  '';

  meta = {
    description = "Software package for computing Gröbner fans and tropical varieties";