public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/biber] epel10.2: Add an integration test with BibLaTeX
@ 2026-08-18 11:40 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-08-18 11:40 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/biber
            Branch : epel10.2
            Commit : 875def016fac883ca3da635b3298588370319234
            Author : Petr Písař <ppisar@redhat.com>
            Date   : 2022-09-20T17:30:30+02:00
            Stats  : +114/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/biber/c/875def016fac883ca3da635b3298588370319234?branch=epel10.2

            Log:
            Add an integration test with BibLaTeX

biber and textlive-biblaetx needs to agree on a format version. The
version exposed with "bcfversion" RPM dependency. To catch the RPM
dependency is in line with the packaged code, this test exhibits a use
of biber from the BibLaTeX.

---
diff --git a/tests/biblatex-integration/main.fmf b/tests/biblatex-integration/main.fmf
new file mode 100644
index 0000000..5b57679
--- /dev/null
+++ b/tests/biblatex-integration/main.fmf
@@ -0,0 +1,23 @@
+summary: Integration with BibLaTex
+description: |
+    This test verifies that a texlive and biber work together. It checks that
+    a LaTeX source with BibLaTeX package with a biber backend compiles and the
+    a bibliography a reference to the bibilography appears in the resulting PDF
+    document.
+
+    <https://bugzilla.redhat.com/show_bug.cgi?id=2048536>
+component:
+    - biber
+    - texlive
+require:
+    - biber
+    - perl-interpreter
+    - perl(Cwd)
+    - perl(File::Temp)
+    - perl(strict)
+    - perl(Test::More)
+    - perl(utf8)
+    - perl(warnings)
+    - poppler-utils
+    - texlive-latex
+test: ./test.pl

diff --git a/tests/biblatex-integration/test.pl b/tests/biblatex-integration/test.pl
new file mode 100755
index 0000000..2253995
--- /dev/null
+++ b/tests/biblatex-integration/test.pl
@@ -0,0 +1,91 @@
+#!/usr/bin/perl
+=encoding utf8
+=head1 LICENSE
+
+Copyright (C) 2022  Petr Písař L<mailto:ppisar@redhat.com>
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+details.
+
+=cut
+
+use utf8;
+use strict;
+use warnings;
+use Test::More tests => 13;
+use File::Temp ();
+use Cwd ();
+
+sub save_file {
+	my ($name, $content) = @_;
+	open(my $fh, '>', $name) or die "Could not create $name file: $!";
+	$fh->print($content);
+	close($fh) or die "Could not save $name: $!";
+	return 1;
+}
+sub read_file {
+	my ($name) = @_;
+	open(my $fh, '<:encoding(UTF-8)', $name) or die "Could not open $name file: $!";
+    local $/ = undef;
+	my $content = $fh->getline();
+	close($fh) or die "Could not read $name: $!";
+	return $content;
+}
+
+my $tmp_dir = File::Temp->newdir();
+ok($tmp_dir, 'Temporary directory created');
+my $old_cwd = Cwd::cwd();
+ok($old_cwd, 'A working directory obtained');
+ok(chdir($tmp_dir), 'Change a working directory to the temporary directory');
+
+
+ok(save_file('test.tex',<<'SOURCE'), 'TeX source created');
+\documentclass{article}
+\usepackage[backend=biber]{biblatex}
+\addbibresource{a.bib}
+\begin{document}
+Hello~\cite{foobar2022}.
+
+\printbibliography
+\end{document}
+SOURCE
+ok(save_file('a.bib', <<'SOURCE'), 'BibTex source created');
+@article{foobar2022,
+        author   = {Foo and Bar},
+        title    = {The paper},
+        journal  = {The journal},
+        date     = {2022},
+        keywords = {trusted},
+}
+SOURCE
+
+ok(!system('pdflatex', 'test.tex'), 'Run pdflatex to extract a bibliography');
+ok(!system('biber', 'test.bcf'), 'Run biber to process the bibliography');
+ok(!system('pdflatex', 'test.tex'), 'Run pdflatex to compute a page layout');
+ok(!system('pdflatex', 'test.tex'), 'Run pdflatex to insert the references');
+
+ok(!system('pdftotext', '-nopgbrk', 'test.pdf'), 'Convert PDF to plain text');
+
+my $typeset_text = read_file('test.txt');
+ok($typeset_text, 'plain text read');
+
+is($typeset_text, <<'EXPECTED', 'Bibliography typeset correctly');
+Hello [1].
+
+References
+[1]
+
+Foo and Bar. “The paper”. In: The journal (2022).
+
+1
+
+EXPECTED
+
+ok(chdir($old_cwd), 'Change a workking directory back to the original directory');

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-18 11:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-18 11:40 [rpms/biber] epel10.2: Add an integration test with BibLaTeX 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox