diff --git a/lib/LaTeXML/Util/Test.pm b/lib/LaTeXML/Util/Test.pm index 6b49d3201..43be8d555 100644 --- a/lib/LaTeXML/Util/Test.pm +++ b/lib/LaTeXML/Util/Test.pm @@ -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)) { } @@ -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; } diff --git a/t/50_structure.t b/t/50_structure.t index 8d7b3cbcc..ab576bd31 100644 --- a/t/50_structure.t +++ b/t/50_structure.t @@ -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' } }); diff --git a/t/80_complex.t b/t/80_complex.t index f6f2b4795..28918d36c 100644 --- a/t/80_complex.t +++ b/t/80_complex.t @@ -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 } });