Commit 7876c91d authored by Lily Foster's avatar Lily Foster Committed by Bjørn Forsman
Browse files

freecad: add passthru.tests.python-path to test patch

parent e51b7f68
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
, boost
, coin3d
, eigen
, freecad  # for passthru.tests
, gfortran
, gts
, hdf5
@@ -35,6 +36,7 @@
, qtwebengine
, qtx11extras
, qtxmlpatterns
, runCommand  # for passthru.tests
, scipy
, shiboken2
, soqt
@@ -147,6 +149,21 @@ stdenv.mkDerivation (finalAttrs: {
    ln -s $out/bin/FreeCADCmd $out/bin/freecadcmd
  '';

  passthru.tests = {
    # Check that things such as argument parsing still work correctly with
    # the above PYTHONPATH patch. Previously the patch used above changed
    # the `PyConfig_InitIsolatedConfig` to `PyConfig_InitPythonConfig`,
    # which caused the built-in interpreter to attempt (and fail) to doubly
    # parse argv. This should catch if that ever regresses and also ensures
    # that PYTHONPATH is still respected enough for the FreeCAD console to
    # successfully run and check that it was included in `sys.path`.
    python-path = runCommand "freecad-test-console" {
      nativeBuildInputs = [ freecad ];
    } ''
      HOME="$(mktemp -d)" PYTHONPATH="$(pwd)/test" FreeCADCmd --log-file $out -c "if not '$(pwd)/test' in sys.path: sys.exit(1)" </dev/null
    '';
  };

  meta = {
    homepage = "https://www.freecad.org";
    description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";