Unverified Commit acc5ae74 authored by Liam Murphy's avatar Liam Murphy
Browse files

gfan: disable hardening, enable tests

`libcxxhardeningfast` was causing some of Sage's tests to fail on
Darwin. I disabled it, and then enabled gfan's tests so that failures
like this will be attributed to gfan itself in future.
parent 5ab615a9
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";