Skip to content

Commit

Permalink
update testfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
stone-zeng committed Feb 20, 2020
1 parent f6a4c99 commit 6450f6c
Show file tree
Hide file tree
Showing 71 changed files with 60,849 additions and 11,968 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on: [push]

env:
CTAN_URL: https://mirrors.rit.edu/CTAN
TL_PACKAGES: adobemapping amsfonts amsmath caption cjk cjkpunct cjkutils cm ctablestack ctex currfile dvipdfmx environ etex etoolbox euenc fancyhdr fandol filehook fontspec graphics graphics-cfg graphics-def iftex kantlipsum knuth-lib l3backend l3build l3experimental l3kernel l3packages latex-bin lm lm-math lualatex-math lualibs luaotfload luatex luatex85 luatexbase luatexja metafont mfware ms oberdiek platex-tools preview psnfss tex tex-ini-files tools trimspaces ucharcat ulem unicode-data uplatex varwidth xcjk2uni xcolor xecjk xetex xkeyval xunicode zhmetrics zhmetrics-uptex zhnumber
TL_PACKAGES: adobemapping amsfonts amsmath caption cjk cjkpunct cjkutils cm ctablestack ctex currfile dvipdfmx etex etoolbox euenc fandol filehook fontspec graphics graphics-cfg graphics-def iftex knuth-lib l3backend l3build l3experimental l3kernel l3packages latex-bin lm lm-math lualatex-math lualibs luaotfload luatex luatex85 luatexbase luatexja metafont mfware ms oberdiek platex-tools psnfss tex tex-ini-files tools ucharcat ulem unicode-data uplatex xcjk2uni xcolor xecjk xetex xkeyval xunicode zhmetrics zhmetrics-uptex zhnumber

jobs:
build-ubuntu:
Expand Down
249 changes: 128 additions & 121 deletions build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ unpackfiles = {"zhlipsum.dtx"}
gbkfiles = {"zhlipsum-gbk.def"}
big5files = {"zhlipsum-big5.def"}

checkengines = {"xetex", "luatex"}

unpackexe = "xetex"
unpackopts = "-file-line-error -halt-on-error -interaction=batchmode"

-- checkopts = "-interaction=batchmode"
-- unpackopts = "-interaction=batchmode"

checkopts = "-interaction=batchmode"
unpackopts = "-interaction=batchmode"
-- stdengine = "xetex"
checkengines = {"pdftex", "xetex", "luatex", "uptex"}
specialformats = {}
specialformats.latex = {
pdftex = {binary = "latex", options = "-output-format=dvi"},
uptex = {binary = "euptex"}
}

function zhconv(input, output, encoding)
local input_tmp = input .. ".tmp"
Expand Down Expand Up @@ -50,127 +57,127 @@ function hooked_bundleunpack(sourcedirs, sources)
end
end

function modified_check(names)
local errorlevel = 0
if testfiledir ~= "" and direxists(testfiledir) then
if not options["rerun"] then
checkinit()
end
local hide = true
--[[
-- To suppress TeX output.
if names and next(names) then
hide = false
end
]]--
names = names or { }
-- No names passed: find all test files
if not next(names) then
local excludenames = { }
for _,glob in pairs(excludetests) do
for _,name in pairs(filelist(testfiledir, glob .. lvtext)) do
excludenames[jobname(name)] = true
end
for _,name in pairs(filelist(unpackdir, glob .. lvtext)) do
excludenames[jobname(name)] = true
end
for _,name in pairs(filelist(testfiledir, glob .. pvtext)) do
excludenames[jobname(name)] = true
end
end
local function addname(name)
if not excludenames[jobname(name)] then
insert(names,jobname(name))
end
end
for _,glob in pairs(includetests) do
for _,name in pairs(filelist(testfiledir, glob .. lvtext)) do
addname(name)
end
for _,name in pairs(filelist(testfiledir, glob .. pvtext)) do
addname(name)
end
for _,name in pairs(filelist(unpackdir, glob .. lvtext)) do
if fileexists(testfiledir .. "/" .. name) then
print("Duplicate test file: " .. i)
return 1
end
addname(name)
end
end
sort(names)
-- Deal limiting range of names
if options["first"] then
local allnames = names
local active = false
local firstname = options["first"]
names = { }
for _,name in ipairs(allnames) do
if name == firstname then
active = true
end
if active then
insert(names,name)
end
end
end
if options["last"] then
local allnames = names
local lastname = options["last"]
names = { }
for _,name in ipairs(allnames) do
insert(names,name)
if name == lastname then
break
end
end
end
end
-- https://stackoverflow.com/a/32167188
local function shuffle(tbl)
local len, random = #tbl, rnd
for i = len, 2, -1 do
local j = random(1, i)
tbl[i], tbl[j] = tbl[j], tbl[i]
end
return tbl
end
if options["shuffle"] then
names = shuffle(names)
end
-- Actually run the tests
print("Running checks on")
local i = 0
for _,name in ipairs(names) do
i = i + 1
print(" " .. name .. " (" .. i.. "/" .. #names ..")")
local errlevel = runcheck(name, hide)
-- Return value must be 1 not errlevel
if errlevel ~= 0 then
if options["halt-on-error"] then
return 1
else
errorlevel = 1
-- visually show that something has failed
print(" --> failed\n")
end
end
end
if errorlevel ~= 0 then
checkdiff()
else
print("\n All checks passed\n")
end
end
return errorlevel
end
-- function modified_check(names)
-- local errorlevel = 0
-- if testfiledir ~= "" and direxists(testfiledir) then
-- if not options["rerun"] then
-- checkinit()
-- end
-- local hide = true
-- --[[
-- -- To suppress TeX output.
-- if names and next(names) then
-- hide = false
-- end
-- ]]--
-- names = names or { }
-- -- No names passed: find all test files
-- if not next(names) then
-- local excludenames = { }
-- for _,glob in pairs(excludetests) do
-- for _,name in pairs(filelist(testfiledir, glob .. lvtext)) do
-- excludenames[jobname(name)] = true
-- end
-- for _,name in pairs(filelist(unpackdir, glob .. lvtext)) do
-- excludenames[jobname(name)] = true
-- end
-- for _,name in pairs(filelist(testfiledir, glob .. pvtext)) do
-- excludenames[jobname(name)] = true
-- end
-- end
-- local function addname(name)
-- if not excludenames[jobname(name)] then
-- insert(names,jobname(name))
-- end
-- end
-- for _,glob in pairs(includetests) do
-- for _,name in pairs(filelist(testfiledir, glob .. lvtext)) do
-- addname(name)
-- end
-- for _,name in pairs(filelist(testfiledir, glob .. pvtext)) do
-- addname(name)
-- end
-- for _,name in pairs(filelist(unpackdir, glob .. lvtext)) do
-- if fileexists(testfiledir .. "/" .. name) then
-- print("Duplicate test file: " .. i)
-- return 1
-- end
-- addname(name)
-- end
-- end
-- sort(names)
-- -- Deal limiting range of names
-- if options["first"] then
-- local allnames = names
-- local active = false
-- local firstname = options["first"]
-- names = { }
-- for _,name in ipairs(allnames) do
-- if name == firstname then
-- active = true
-- end
-- if active then
-- insert(names,name)
-- end
-- end
-- end
-- if options["last"] then
-- local allnames = names
-- local lastname = options["last"]
-- names = { }
-- for _,name in ipairs(allnames) do
-- insert(names,name)
-- if name == lastname then
-- break
-- end
-- end
-- end
-- end
-- -- https://stackoverflow.com/a/32167188
-- local function shuffle(tbl)
-- local len, random = #tbl, rnd
-- for i = len, 2, -1 do
-- local j = random(1, i)
-- tbl[i], tbl[j] = tbl[j], tbl[i]
-- end
-- return tbl
-- end
-- if options["shuffle"] then
-- names = shuffle(names)
-- end
-- -- Actually run the tests
-- print("Running checks on")
-- local i = 0
-- for _,name in ipairs(names) do
-- i = i + 1
-- print(" " .. name .. " (" .. i.. "/" .. #names ..")")
-- local errlevel = runcheck(name, hide)
-- -- Return value must be 1 not errlevel
-- if errlevel ~= 0 then
-- if options["halt-on-error"] then
-- return 1
-- else
-- errorlevel = 1
-- -- visually show that something has failed
-- print(" --> failed\n")
-- end
-- end
-- end
-- if errorlevel ~= 0 then
-- checkdiff()
-- else
-- print("\n All checks passed\n")
-- end
-- end
-- return errorlevel
-- end

function main(target, names)
unhooked_bundleunpack = bundleunpack
bundleunpack = hooked_bundleunpack
target_list["check"]["func"] = modified_check
-- target_list["check"]["func"] = modified_check
stdmain(target, names)
end

kpse.set_program_name("kpsewhich")
dofile(kpse.lookup("l3build.lua"))
-- kpse.set_program_name("kpsewhich")
-- dofile(kpse.lookup("l3build.lua"))
Loading

0 comments on commit 6450f6c

Please sign in to comment.