Unverified Commit 6802bd31 authored by Ben Siraphob's avatar Ben Siraphob Committed by GitHub
Browse files

treewide: use `ctestCheckHook` (part 1) (#406011)

parents a4586d1c 98968dae
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
  heatshrink,
  catch2,
  webkitgtk_4_0,
  ctestCheckHook,
  withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd,
  systemd,
  wxGTK-override ? null,
@@ -205,16 +206,12 @@ stdenv.mkDerivation (finalAttrs: {
  '';

  doCheck = true;

  checkPhase = ''
    runHook preCheck

    ctest \
      --force-new-ctest-process \
      -E 'libslic3r_tests|sla_print_tests'

    runHook postCheck
  '';
  nativeCheckInputs = [ ctestCheckHook ];
  checkFlags = [
    "--force-new-ctest-process"
    "-E"
    "libslic3r_tests|sla_print_tests"
  ];

  meta =
    with lib;
+1 −5
Original line number Diff line number Diff line
@@ -60,11 +60,7 @@ stdenv.mkDerivation rec {
  '';

  doCheck = true;
  checkPhase = ''
    runHook preCheck
    ctest -j 1
    runHook postCheck
  '';
  enableParallelChecking = false;

  meta = with lib; {
    description = "Open framework for storing and sharing scene data";
+14 −19
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
  doctest,
  xcodebuild,
  makeWrapper,
  ctestCheckHook,
  writableTmpDirAsHomeHook,
  nix-update-script,
}:

@@ -82,31 +84,24 @@ stdenv.mkDerivation (finalAttrs: {
    # test/run requires the compgen function which is available in
    # bashInteractive, but not bash.
    bashInteractive
    ctestCheckHook
    writableTmpDirAsHomeHook
  ] ++ lib.optional stdenv.hostPlatform.isDarwin xcodebuild;

  checkInputs = [
    doctest
  ];

  checkPhase =
    let
      badTests =
  disabledTests =
    [
      "test.trim_dir" # flaky on hydra (possibly filesystem-specific?)
      "test.fileclone" # flaky on hydra, also seems to fail on zfs
    ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      "test.basedir"
          "test.fileclone" # flaky on hydra (possibly filesystem-specific?)
      "test.multi_arch"
      "test.nocpp2"
    ];
    in
    ''
      runHook preCheck
      export HOME=$(mktemp -d)
      ctest --output-on-failure -E '^(${lib.concatStringsSep "|" badTests})$'
      runHook postCheck
    '';

  passthru = {
    # A derivation that provides gcc and g++ commands, but that
+6 −2
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
  libbfd,
  libopcodes,
  otf2,
  ctestCheckHook,
  versionCheckHook,
}:

@@ -54,8 +55,6 @@ stdenv.mkDerivation (finalAttrs: {

  cmakeFlags = [
    (lib.cmakeBool "EZTRACE_ENABLE_MEMORY" true)
    # This test is somewhat flaky and fails once per several rebuilds.
    (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;memory_tests")
  ];

  nativeBuildInputs = [
@@ -72,8 +71,13 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  doCheck = true;
  disabledTests = [
    # This test is somewhat flaky and fails once per several rebuilds.
    "memory_tests"
  ];
  nativeCheckInputs = [
    otf2 # `otf2-print` needed by compiler_instrumentation_tests,pthread_tests,posixio_tests
    ctestCheckHook
  ];

  postInstall = ''
+8 −3
Original line number Diff line number Diff line
@@ -41,6 +41,7 @@
  xorg,
  mimalloc,
  opencsg,
  ctestCheckHook,
}:
# clang consume much less RAM than GCC
clangStdenv.mkDerivation rec {
@@ -142,12 +143,16 @@ clangStdenv.mkDerivation rec {

  nativeCheckInputs = [
    mesa.llvmpipeHook
    ctestCheckHook
  ];

  checkPhase = ''
  dontUseNinjaCheck = true;
  checkFlags = [
    "-E"
    # some fontconfig issues cause pdf output to have wrong font
    ctest -j$NIX_BUILD_CORES -E pdfexporttest.\*
  '';
    "pdfexporttest"
  ];

  meta = with lib; {
    description = "3D parametric model compiler (unstable)";
    longDescription = ''
Loading