├── .gitignore ├── README.md ├── check-package ├── l3build-demo ├── README.md ├── build.lua ├── context │ ├── build.lua │ └── testfiles │ │ ├── context001.lvt │ │ └── context001.tlg ├── latex │ ├── build.lua │ └── testfiles │ │ ├── latex001.lvt │ │ ├── latex001.tlg │ │ ├── latex002.lvt │ │ ├── latex002.tlg │ │ ├── latex003.lvt │ │ └── latex003.pdf └── plain │ ├── build.lua │ └── testfiles │ ├── plain001.lvt │ └── plain001.tlg ├── texmf-dist └── web2c │ └── dummy └── tools └── run-while-living.exp /.gitignore: -------------------------------------------------------------------------------- 1 | l3build-demo/build/ 2 | tlpkg 3 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # tltesting 3 | 4 | Development of testing infrastructure for TeX (Live) 5 | 6 | # setup 7 | 8 | link or copy a `tlpkg` directory into the checkout 9 | 10 | more to come 11 | 12 | -------------------------------------------------------------------------------- /check-package: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # Originally written by Norbert Preining, 2017. Public domain. 3 | # 4 | # Test various files on their "usability" or "loadability" 5 | # 6 | # Ideas: 7 | # - tlpobj contains 8 | # testfile ....tex 9 | # reference ....pdf 10 | # later: auto generation 11 | # - .cls => test with pdflatex and compare pdfs 12 | # - .sty => load in article or some other class? 13 | # 14 | # functionality: 15 | # scriptname check [-all] | ... 16 | # checks all/passed packages 17 | # scriptname rebuild [-all] | ... 18 | # rebuilds reference file for all/passed packages 19 | # 20 | # further arguments: 21 | # --basedir BASE location of files: BASE//... 22 | # --master MASTER location of Master tree 23 | # (root of an installation containing tlpkg) 24 | # 25 | # 26 | # TODO 27 | # * fix layout of BASE/... 28 | # 29 | # Future ideas: 30 | # * provide CTAN package for building reference pdf and 31 | # submitting it to TeX Live together with a test file 32 | # 33 | 34 | my $Master; 35 | 36 | BEGIN { 37 | $^W = 1; 38 | $| = 1; 39 | (my $mydir = $0) =~ s,/[^/]*$,,; 40 | if ($mydir eq $0) { 41 | $mydir = "."; 42 | } 43 | #my $tlroot = "$mydir/../.."; 44 | my $tlroot = "$mydir"; 45 | unshift (@INC, "$tlroot/tlpkg"); 46 | #chomp ($Master = `cd $mydir/../.. && pwd`); 47 | chomp ($Master = `pwd`); 48 | } 49 | 50 | use File::Find; 51 | use Getopt::Long; 52 | use Pod::Usage; 53 | 54 | use TeXLive::TLPDB; 55 | use TeXLive::TLConfig; 56 | use TeXLive::TLUtils qw(info debug ddebug debug_hash tlwarn tldie); 57 | 58 | my $prg = TeXLive::TLUtils::basename($0); 59 | 60 | my $opt_basedir = "/home/norbert/Development/TeX/tltesting.git/testfiles"; 61 | my $opt_help = 0; 62 | my $opt_version = 0; 63 | my $opt_all = 0; 64 | 65 | TeXLive::TLUtils::process_logging_options (); 66 | GetOptions ( 67 | "base=s" => \$opt_basedir, 68 | "all|a" => \$opt_all, 69 | "version" => \$opt_version, 70 | "help|?" => \$help) || pod2usage(1); 71 | 72 | pod2usage ("-exitstatus" => 0, "-verbose" => 2) if $help; 73 | if ($opt_version) { print "dev\n"; exit 0; } 74 | 75 | # 76 | if ($opt_all) { die("option -all is not implemented by now!"); } 77 | 78 | # 79 | # we want to setup the master that we are running all tests 80 | # with our own programs 81 | $::installerdir = $Master; # TLUtils.pm should be smarter 82 | $ENV{'PATH'} = "$Master/bin/" . TeXLive::TLUtils::platform() . ":$ENV{PATH}"; 83 | 84 | exit (&main()); 85 | 86 | 87 | sub main { 88 | # no interference from TEXMFHOME, etc. 89 | $ENV{'TEXMFHOME'} = "/nonesuch-home"; 90 | $ENV{'TEXMFVAR'} = "/nonesuch-uvar"; 91 | $ENV{'TEXMFCONFIG'} = "/nonesuch-config"; 92 | $ENV{'TEXMFLOCAL'} = "/nonesuch-local"; 93 | 94 | # load TLPDB 95 | my $tlpdb = TeXLive::TLPDB->new("root" => $Master); 96 | die "cannot find tlpdb in $Master" unless defined($tlpdb); 97 | 98 | # 99 | my $cmd = shift @ARGV; 100 | die("No command passed") if (!$cmd); 101 | 102 | 103 | # setup packages to check: 104 | my @packs = @ARGV; 105 | 106 | my $ret = 0; 107 | if ($cmd eq "check" || $cmd eq "rebuild") { 108 | for my $p (@packs) { 109 | $ret += check_rebuild_package($cmd, $p); 110 | } 111 | } else { 112 | die("unknown command: $cmd"); 113 | } 114 | exit($ret); 115 | } 116 | 117 | 118 | # check or rebuild reference for one package 119 | sub check_rebuild_package { 120 | my ($cmd, $p) = @_; 121 | die "NOT IMPLEMENTED"; 122 | } 123 | 124 | 125 | 126 | __END__ 127 | 128 | =head1 NAME 129 | 130 | check-package - check package for usability 131 | 132 | =head1 SYNOPSIS 133 | 134 | check-package check|rebuild [I