clojure-lsp: add tests

This commit is contained in:
Thiago Kenji Okada 2021-02-04 00:56:20 -03:00
parent 3fa00685ce
commit cd98c0e4ba

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, graalvm11-ce }: { lib, stdenv, fetchurl, fetchFromGitHub, graalvm11-ce, babashka }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "clojure-lsp"; pname = "clojure-lsp";
@ -9,6 +9,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-fLwubRwWa1fu37bdkaCr2uZK79z37wqPLToOb5BlegY="; sha256 = "sha256-fLwubRwWa1fu37bdkaCr2uZK79z37wqPLToOb5BlegY=";
}; };
# For tests
ghSrc = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "1ydf8bgwvjp77wyhjqwzn7crpn5hxmq701czlkhpm5ablnxcwhn7";
};
dontUnpack = true; dontUnpack = true;
buildInputs = [ graalvm11-ce ]; buildInputs = [ graalvm11-ce ];
@ -21,6 +29,7 @@ stdenv.mkDerivation rec {
"-J-Dclojure.spec.skip-macros=true" "-J-Dclojure.spec.skip-macros=true"
"-H:+ReportExceptionStackTraces" "-H:+ReportExceptionStackTraces"
"--enable-url-protocols=jar" "--enable-url-protocols=jar"
# TODO: Enable in GraalVM 21.0.0
# "-H:+InlineBeforeAnalysis" # "-H:+InlineBeforeAnalysis"
"-H:Log=registerResource:" "-H:Log=registerResource:"
"--verbose" "--verbose"
@ -49,8 +58,9 @@ stdenv.mkDerivation rec {
install -Dm755 clojure-lsp $out/bin/clojure-lsp install -Dm755 clojure-lsp $out/bin/clojure-lsp
''; '';
installCheckPhase = '' doCheck = true;
$out/bin/clojure-lsp --version checkPhase = ''
${babashka}/bin/bb ${ghSrc}/integration-test/run-all.clj ./clojure-lsp
''; '';
meta = with lib; { meta = with lib; {