Skip to content

Commit a655489

Browse files
committed
Add tests
1 parent 428a5e8 commit a655489

39 files changed

Lines changed: 17579 additions & 1 deletion

build.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ checkconfigs = {
2727
typesetexe = "xelatex"
2828
unpackexe = "xetex"
2929

30+
excludetests = {
31+
"font-windows",
32+
"font-mac",
33+
}
34+
3035
checkopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
3136
typesetopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
3237

tests/config-bibtex.lua

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ checkruns = 3
44

55
function runtest_tasks(name, run)
66
if run == 1 then
7-
return "bibtex -terse " .. name
7+
local aux_files = filelist(testdir, name .. "*.aux")
8+
local commands = {}
9+
for _, aux_file in ipairs(aux_files) do
10+
local base_name = jobname(aux_file)
11+
if #aux_files == 1 or base_name ~= name then
12+
table.insert(commands, "bibtex -terse " .. base_name)
13+
end
14+
end
15+
local command = table.concat(commands, os_concat)
16+
-- io.stderr:write(command .. "\n")
17+
return command
818
else
919
return ""
1020
end
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
\input{regression-test}
2+
\documentclass[degree=doctor, fontset=fandol]{ustcthesis}
3+
4+
\usepackage[sort]{natbib}
5+
\bibliographystyle{ustcthesis-numerical}
6+
7+
\pagestyle{empty}
8+
9+
\begin{document}
10+
\START
11+
\showoutput
12+
13+
引用\citet{sunliguang2016jidi}测试\par
14+
引用\citet[42]{sunliguang2016jidi}测试\par
15+
引用\citep{liyongchi2016zhangliang}测试\par
16+
引用\citep[42]{liyongchi2016zhangliang}测试\par
17+
引用\citep[见][]{liujingshuang2014shidi}测试\par
18+
引用\citep[见][42]{liujingshuang2014shidi}测试\par
19+
20+
Citation \citet{crawford1995future} test\par
21+
Citation \citet[42]{crawford1995future} test\par
22+
Citation\citep{crawford1995future} test\par
23+
Citation\citep[42]{crawford1995future} test\par
24+
Citation \citep[see][]{ifla1977names} test\par
25+
Citation \citep[see][42]{ifla1977names} test\par
26+
27+
引用\citep{sunliguang2016jidi}测试\par
28+
引用\citep{liyongchi2016zhangliang,liujingshuang2014shidi}测试\par
29+
引用\citep{crawford1995future,ifla1977names,chenggenwei1999hongshui}测试\par
30+
31+
\nocite{*}
32+
33+
\backmatter
34+
\bibliography{refs-numerical}
35+
36+
\clearpage
37+
\OMIT
38+
\end{document}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
\input{regression-test}
2+
\documentclass[degree=doctor, fontset=fandol]{ustcthesis}
3+
4+
\begin{filecontents}[noheader, overwrite]{\jobname-chapter-1.tex}
5+
\chapter{Foo}
6+
\cite{sunliguang2016jidi, liyongchi2016zhangliang}\par
7+
\bibliographystyle{ustcthesis-numerical}
8+
\bibliography{refs-numerical}
9+
\end{filecontents}
10+
11+
\begin{filecontents}[noheader, overwrite]{\jobname-chapter-2.tex}
12+
\chapter{Foo}
13+
\cite{sunliguang2016jidi, liujingshuang2014shidi}\par
14+
\bibliographystyle{ustcthesis-numerical}
15+
\bibliography{refs-numerical}
16+
\end{filecontents}
17+
18+
\usepackage[sort, sectionbib]{natbib}
19+
\bibliographystyle{ustcthesis-numerical}
20+
21+
\usepackage{chapterbib}
22+
23+
24+
\pagestyle{empty}
25+
26+
\begin{document}
27+
\START
28+
\showoutput
29+
30+
\include{\jobname-chapter-1}
31+
\include{\jobname-chapter-2}
32+
33+
\clearpage
34+
\OMIT
35+
\end{document}

0 commit comments

Comments
 (0)