Merge pull request #315041 from kilianar/stellarium-version-test

stellarium: add passthru.tests.version
This commit is contained in:
Aleksana 2024-07-11 21:11:06 +08:00 committed by GitHub
commit 6c1414eab5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,8 @@
, qttools
, exiv2
, nlopt
, testers
, xvfb-run
}:
stdenv.mkDerivation (finalAttrs: {
@ -93,6 +95,18 @@ stdenv.mkDerivation (finalAttrs: {
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = ''
# Create a temporary home directory because stellarium aborts with an
# error if it can't write some configuration files.
tmpdir=$(mktemp -d)
# stellarium can't be run in headless mode, therefore we need xvfb-run.
HOME="$tmpdir" ${xvfb-run}/bin/xvfb-run stellarium --version
'';
};
meta = {
description = "Free open-source planetarium";
mainProgram = "stellarium";