aboutsummaryrefslogtreecommitdiff
path: root/pkgs/test
diff options
context:
space:
mode:
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>2020-04-10 19:47:44 -0400
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2020-10-06 19:24:41 -0400
commit074f6d9d848dc2672b71b82683de67f4dab9c30b (patch)
tree5b427a8ab6e97a48a79b3294bcc90c44a96624eb /pkgs/test
parent86e6adc799ef0dd9019002f623f733973b6e46dd (diff)
tests.texlive: init
Diffstat (limited to 'pkgs/test')
-rw-r--r--pkgs/test/default.nix2
-rw-r--r--pkgs/test/texlive/default.nix66
2 files changed, 68 insertions, 0 deletions
diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix
index c248eebaec39..85142090dd42 100644
--- a/pkgs/test/default.nix
+++ b/pkgs/test/default.nix
@@ -39,5 +39,7 @@ with pkgs;
patch-shebangs = callPackage ./patch-shebangs {};
+ texlive = callPackage ./texlive {};
+
writers = callPackage ../build-support/writers/test.nix {};
}
diff --git a/pkgs/test/texlive/default.nix b/pkgs/test/texlive/default.nix
new file mode 100644
index 000000000000..30d0026c848d
--- /dev/null
+++ b/pkgs/test/texlive/default.nix
@@ -0,0 +1,66 @@
+{ runCommandNoCC, fetchurl, file, texlive }:
+
+{
+ chktex = runCommandNoCC "texlive-test-chktex" {
+ nativeBuildInputs = [
+ (with texlive; combine { inherit scheme-infraonly chktex; })
+ ];
+ input = builtins.toFile "chktex-sample.tex" ''
+ \documentclass{article}
+ \begin{document}
+ \LaTeX is great
+ \end{document}
+ '';
+ } ''
+ chktex -v -nall -w1 "$input" 2>&1 | tee "$out"
+ grep "One warning printed" "$out"
+ '';
+
+ # https://github.com/NixOS/nixpkgs/issues/75605
+ dvipng = runCommandNoCC "texlive-test-dvipng" {
+ nativeBuildInputs = [ file texlive.combined.scheme-medium ];
+ input = fetchurl {
+ name = "test_dvipng.tex";
+ url = "http://git.savannah.nongnu.org/cgit/dvipng.git/plain/test_dvipng.tex?id=b872753590a18605260078f56cbd6f28d39dc035";
+ sha256 = "1pjpf1jvwj2pv5crzdgcrzvbmn7kfmgxa39pcvskl4pa0c9hl88n";
+ };
+ } ''
+ cp "$input" ./document.tex
+
+ latex document.tex
+ dvipng -T tight -strict -picky document.dvi
+ for f in document*.png; do
+ file "$f" | tee output
+ grep PNG output
+ done
+
+ mkdir "$out"
+ mv document*.png "$out"/
+ '';
+
+ # https://github.com/NixOS/nixpkgs/issues/75070
+ dvisvgm = runCommandNoCC "texlive-test-dvisvgm" {
+ nativeBuildInputs = [ file texlive.combined.scheme-medium ];
+ input = builtins.toFile "dvisvgm-sample.tex" ''
+ \documentclass{article}
+ \begin{document}
+ mwe
+ \end{document}
+ '';
+ } ''
+ cp "$input" ./document.tex
+
+ latex document.tex
+ dvisvgm document.dvi -n -o document_dvi.svg
+ cat document_dvi.svg
+ file document_dvi.svg | grep SVG
+
+ pdflatex document.tex
+ dvisvgm -P document.pdf -n -o document_pdf.svg
+ cat document_pdf.svg
+ file document_pdf.svg | grep SVG
+
+ mkdir "$out"
+ mv document*.svg "$out"/
+ '';
+}