spidermonkey_*: add tests

This commit is contained in:
Kirill A. Korinsky 2022-07-04 20:49:53 +02:00 committed by Jan Tojnar
parent 9a99e98ea4
commit 457b124ad2
2 changed files with 18 additions and 3 deletions

View file

@ -1,6 +1,7 @@
{ version, hash }:
{ lib
{ callPackage
, lib
, stdenv
, fetchurl
, fetchpatch
@ -28,7 +29,7 @@
, zlib
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: rec {
pname = "spidermonkey";
inherit version;
@ -160,6 +161,10 @@ stdenv.mkDerivation rec {
ln -s $out/bin/js${lib.versions.major version} $out/bin/js
'';
passthru.tests.run = callPackage ./test.nix {
spidermonkey = finalAttrs.finalPackage;
};
meta = with lib; {
description = "Mozilla's JavaScript engine written in C/C++";
homepage = "https://spidermonkey.dev/";
@ -167,4 +172,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ abbradar lostnet ];
platforms = platforms.linux;
};
}
})

View file

@ -0,0 +1,10 @@
{ runCommand, spidermonkey }:
runCommand "spidermonkey-test-run" {
nativeBuildInputs = [
spidermonkey
];
} ''
diff -U3 --color=auto <(js <(echo "console.log('Hello, world\!')")) <(echo 'Hello, world!')
touch $out
''