Skip to content

Commit

Permalink
only run expl3-dependent tests in continuous integration (#2234)
Browse files Browse the repository at this point in the history
* only run expl3-dependent tests in continuous integration

* also transition 83_expl3.t to new CI idiom
  • Loading branch information
dginev authored Oct 15, 2023
1 parent e006ad9 commit 56886ab
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
7 changes: 7 additions & 0 deletions lib/LaTeXML/Util/Test.pm
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,14 @@ sub check_requirements {
next unless $reqmts;
my @required_packages = ();
my $texlive_min = 0;
my $required_env;
if (!(ref $reqmts)) {
@required_packages = ($reqmts); }
elsif (ref $reqmts eq 'ARRAY') {
@required_packages = @$reqmts; }
elsif (ref $reqmts eq 'HASH') {
@required_packages = (ref $$reqmts{packages} eq 'ARRAY' ? @{ $$reqmts{packages} } : $$reqmts{packages});
$required_env = $$reqmts{env};
$texlive_min = $$reqmts{texlive_min} || 0; }
foreach my $reqmt (@required_packages) {
if (pathname_kpsewhich($reqmt) || pathname_find($reqmt)) { }
Expand All @@ -105,6 +107,11 @@ sub check_requirements {
my $message = "Minimal texlive $texlive_min requirement not met for $test";
diag("Skip: $message");
skip($message, $ntests);
return 0; }
elsif ($required_env && !$ENV{$required_env}) {
my $message = "$test is only checked in continuous integration. (use make test CI=true)";
diag("Skip: $message");
skip($message, $ntests);
return 0; } }
return 1; }

Expand Down
1 change: 1 addition & 0 deletions t/50_structure.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ latexml_tests("t/structure",
amsarticle => 'amsart.cls',
csquotes => 'csquotes.sty',
glossary => {
env => 'CI', # only run in continuous integration
texlive_min => 2016,
packages => 'glossaries.sty' } });
4 changes: 3 additions & 1 deletion t/80_complex.t
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ use LaTeXML::Util::Test;
latexml_tests("t/complex",
requires => {
cleveref_minimal => 'cleveref.sty',
si => { packages => 'siunitx.sty', texlive_min => 2015 } });
si => {
env=>'CI', # only runs in continuous integration
packages => 'siunitx.sty', texlive_min => 2015 } });
8 changes: 2 additions & 6 deletions t/83_expl3.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ use strict;
use warnings;
use LaTeXML::Util::Test;

if (!$ENV{"CI"}) {
plan skip_all => "Only checked in continuous integration. (use make test CI=true)";
done_testing();
exit;
}

latexml_tests("t/expl3",
requires => {
tilde_tricks => {
env => 'CI',
texlive_min => 2018,
packages => 'expl3.sty' },
xparse => {
env => 'CI',
texlive_min => 2019,
packages => ['expl3.sty', 'xparse.sty']
} });

0 comments on commit 56886ab

Please sign in to comment.