Commit 50b9f412 authored by Emily's avatar Emily
Browse files

hydrus: use the native test runner

This eliminates a nose dependency and lets us actually run all the
tests. Even though it throws up exceptions about the missing SWF tools,
I have verified that the tests are actually getting run properly
(i.e., if you adjust an assertion to compare against bogus values,
the build does fail).
parent 14b0b5a4
Loading
Loading
Loading
Loading
+11 −34
Original line number Diff line number Diff line
@@ -83,44 +83,10 @@ python3Packages.buildPythonPackage rec {
  ];

  nativeCheckInputs = with python3Packages; [
    nose
    mock
    httmock
  ];

  # most tests are failing, presumably because we are not using test.py
  checkPhase = ''
    runHook preCheck

    nosetests $src/hydrus/test  \
      -e TestClientAPI \
      -e TestClientConstants \
      -e TestClientDaemons \
      -e TestClientData \
      -e TestClientDB \
      -e TestClientDBDuplicates \
      -e TestClientDBTags \
      -e TestClientImageHandling \
      -e TestClientImportOptions \
      -e TestClientListBoxes \
      -e TestClientMigration \
      -e TestClientNetworking \
      -e TestClientTags \
      -e TestClientThreading \
      -e TestDialogs \
      -e TestFunctions \
      -e TestHydrusNetwork \
      -e TestHydrusNATPunch \
      -e TestHydrusSerialisable \
      -e TestHydrusServer \
      -e TestHydrusSessions \
      -e TestServer \
      -e TestClientMetadataMigration \
      -e TestClientFileStorage \

    runHook postCheck
  '';

  outputs = [ "out" "doc" ];

  installPhase = ''
@@ -140,6 +106,7 @@ python3Packages.buildPythonPackage rec {
    mkdir -p $out/bin
    install -m0755 hydrus_server.py $out/bin/hydrus-server
    install -m0755 hydrus_client.py $out/bin/hydrus-client
    install -m0755 hydrus_test.py $out/bin/hydrus-test

    # desktop item
    mkdir -p "$out/share/icons/hicolor/scalable/apps"
@@ -154,6 +121,16 @@ python3Packages.buildPythonPackage rec {
    runHook postInstall
  '';

  checkPhase = ''
    runHook preCheck

    export QT_QPA_PLATFORM=offscreen
    export HOME=$(mktemp -d)
    $out/bin/hydrus-test

    runHook postCheck
  '';

  dontWrapQtApps = true;
  preFixup = ''
    makeWrapperArgs+=("''${qtWrapperArgs[@]}")