translatelocally: add passthru test

This commit is contained in:
pacien 2023-09-30 21:45:54 +02:00
parent 3f9ea32279
commit a6515b40d1

View File

@ -1,5 +1,6 @@
{ lib, stdenv, fetchFromGitHub
, cmake, qt6, libarchive, pcre2, protobuf, gperftools, blas
, runCommand, translatelocally, translatelocally-models
}:
let
@ -53,6 +54,19 @@ in stdenv.mkDerivation (finalAttrs: {
"-DCBLAS_LIBRARIES=-lcblas"
];
passthru.tests = {
cli-translate = runCommand "${finalAttrs.pname}-test-cli-translate" {
nativeBuildInputs = [
translatelocally
translatelocally-models.fr-en-tiny
];
} ''
export LC_ALL="C.UTF-8"
echo "Bonjour" | translateLocally -m fr-en-tiny > $out
diff "$out" <(echo "Hello")
'';
};
meta = with lib; {
mainProgram = "translateLocally";
homepage = "https://translatelocally.com/";