cloudcompare.tests: Add VLM screenshot analysis
This commit is contained in:
@@ -364,6 +364,7 @@ in
|
||||
};
|
||||
cloud-init = runTest ./cloud-init.nix;
|
||||
cloud-init-hostname = runTest ./cloud-init-hostname.nix;
|
||||
cloudcompare = import ./cloudcompare.nix { inherit pkgs runTest; };
|
||||
cloudlog = runTest ./cloudlog.nix;
|
||||
cntr = import ./cntr.nix {
|
||||
inherit (pkgs) lib;
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
{ pkgs, runTest }:
|
||||
let
|
||||
testFile = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/asmaloney/libE57Format-test-data/bbcacec05d60f923869545c5eab33d94c390d50e/self/ColouredCubeFloat.e57";
|
||||
hash = "sha256-bb95crNYvX3Qhkx4k6Sqe2GjOf1u4nxxswMfdjyXfTM=";
|
||||
};
|
||||
|
||||
vmTest = runTest {
|
||||
name = "cloudcompare-vm";
|
||||
meta.maintainers = with pkgs.lib.maintainers; [
|
||||
nh2
|
||||
];
|
||||
|
||||
enableOCR = true;
|
||||
|
||||
nodes.machine =
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./common/x11.nix
|
||||
];
|
||||
|
||||
services.xserver.enable = true;
|
||||
environment.systemPackages = [
|
||||
pkgs.cloudcompare
|
||||
];
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
start_all()
|
||||
machine.wait_for_x()
|
||||
|
||||
machine.execute("CloudCompare ${testFile} >&2 &")
|
||||
machine.wait_for_window("CloudCompare")
|
||||
|
||||
# Wait for the file to be loaded; CloudCompare shows "loaded successfully" in its log panel at the bottom.
|
||||
machine.wait_for_text("loaded successfully")
|
||||
|
||||
machine.screenshot("screen.png")
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
vm = vmTest;
|
||||
|
||||
screenshot-analysis = pkgs.callPackage ./vlm-screenshot-question.nix {
|
||||
name = "cloudcompare-screenshot-analysis";
|
||||
screenshot = "${vmTest}/screen.png";
|
||||
question = ''
|
||||
Look at this screenshot of a desktop application.
|
||||
Answer: Does the application show a 3D point cloud viewer (CloudCompare) that has successfully loaded and is displaying a coloured point cloud?
|
||||
Evidence of success: a 3D viewport with coloured points is visible AND there are no error dialogs or error messages.
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -16,6 +16,7 @@
|
||||
mpfr,
|
||||
pcl,
|
||||
libsForQt5,
|
||||
nixosTests,
|
||||
onetbb,
|
||||
xercesc,
|
||||
wrapGAppsHook3,
|
||||
@@ -162,6 +163,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
})
|
||||
];
|
||||
|
||||
passthru.tests = nixosTests.cloudcompare;
|
||||
|
||||
meta = {
|
||||
description = "3D point cloud and mesh processing software";
|
||||
homepage = "https://cloudcompare.org";
|
||||
|
||||
Reference in New Issue
Block a user