Skip to content

Commit f6fc80a

Browse files
authored
flent: convert to unittestCheckHook and add passthru.updateScript (#361633)
2 parents d5d6b11 + f922419 commit f6fc80a

File tree

1 file changed

+8
-19
lines changed

1 file changed

+8
-19
lines changed

pkgs/by-name/fl/flent/package.nix

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
fetchPypi,
55
procps,
66
qt5,
7-
xvfb-run,
7+
nix-update-script,
88
}:
99
python3Packages.buildPythonApplication rec {
1010
pname = "flent";
@@ -25,28 +25,15 @@ python3Packages.buildPythonApplication rec {
2525
qtpy
2626
];
2727

28-
nativeCheckInputs = [
29-
python3Packages.mock
30-
xvfb-run
31-
];
32-
33-
checkPhase = ''
34-
runHook preCheck
28+
nativeCheckInputs = [ python3Packages.unittestCheckHook ];
3529

30+
preCheck = ''
3631
# we want the gui tests to always run
3732
sed -i 's|self.skip|pass; #&|' unittests/test_gui.py
3833
39-
export XDG_RUNTIME_DIR=$(mktemp -d)
40-
export HOME=$(mktemp -d)
41-
cat >test-runner <<EOF
42-
#!/bin/sh
43-
${python3Packages.python.interpreter} -m unittest discover
44-
EOF
45-
chmod +x test-runner
46-
wrapQtApp test-runner --prefix PYTHONPATH : $PYTHONPATH
47-
xvfb-run -s '-screen 0 800x600x24' ./test-runner
48-
49-
runHook postCheck
34+
# Dummy qt setup for gui tests
35+
export QT_PLUGIN_PATH="${qt5.qtbase.bin}/${qt5.qtbase.qtPluginPrefix}"
36+
export QT_QPA_PLATFORM=offscreen
5037
'';
5138

5239
preFixup = ''
@@ -56,11 +43,13 @@ python3Packages.buildPythonApplication rec {
5643
)
5744
'';
5845

46+
passthru.updateScript = nix-update-script { };
5947
meta = {
6048
description = "FLExible Network Tester";
6149
homepage = "https://flent.org";
6250
license = lib.licenses.gpl3;
6351
maintainers = with lib.maintainers; [ mmlb ];
6452
mainProgram = "flent";
53+
badPlatforms = lib.platforms.darwin;
6554
};
6655
}

0 commit comments

Comments
 (0)