Skip to content

Commit

Permalink
add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
zepinglee committed Sep 26, 2019
1 parent 4caaa1b commit 9e14596
Show file tree
Hide file tree
Showing 97 changed files with 74,419 additions and 25 deletions.
21 changes: 18 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
## distribution files
.DS_Store
package-lock.json
node_modules/
dist/

## generated files:
dtx-style.sty
thuthesis.cls
thuthesis.cfg
thuthesis.pdf
main.pdf
spine.pdf
*.hd

## test files:
build/
testfiles/**/*.pdf

## Core latex/pdflatex auxiliary files:
*.aux
*.lof
Expand All @@ -24,6 +29,10 @@ spine.pdf
*.cb
*.cb2
.*.lb
!testfiles/**/*.aux
!testfiles/**/*.toc
!testfiles/**/*.lof
!testfiles/**/*.lot

## Intermediate documents:
*.dvi
Expand Down Expand Up @@ -123,6 +132,9 @@ acs-*.bib
*.gls
*.glsdefs

# uncomment this for glossaries-extra (will ignore makeindex's style files!)
# *.ist

# gnuplottex
*-gnuplottex-*

Expand Down Expand Up @@ -150,11 +162,13 @@ acs-*.bib
# listings
*.lol

# luatexja-ruby
*.ltjruby

# makeidx
*.idx
*.ilg
*.ind
*.ist

# minitoc
*.maf
Expand Down Expand Up @@ -234,8 +248,9 @@ pythontex-files-*/
# xindy
*.xdy

# xypic precompiled matrices
# xypic precompiled matrices and outlines
*.xyc
*.xyd

# endfloat
*.ttt
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@ install:
$INSTALL/install-tl -profile $INSTALL/tl.profile;
fi
- tlmgr update --self --all −−no−auto−install;
- tlmgr update --self --all −−no−auto−install

- tlmgr install latexmk
- tlmgr install latexmk l3build
fontname fontspec l3kernel l3packages xetex
cjk ctex environ ms trimspaces ulem xecjk zhnumber
fandol tex-gyre xits
booktabs caption diagbox enumitem eso-pic etoolbox filehook float footmisc
fp multirow notoccite ntheorem pdfpages pict2e unicode-math xcolor zapfding
fontaxes kastrup listings lm metalogo newpx newtx palatino pxfonts thumbpdf
txfonts xkeyval
nomencl

before_script:
- sed -i 's/\[RawFeature={vertical:}\]{FangSong}/\[Extension=.otf,RawFeature={vertical:}\]{FandolFang-Regular}/' spine.tex
Expand All @@ -42,3 +43,4 @@ script:
- make thesis
- make spine
- make doc
- make test
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ else
RM = rm -f
endif

.PHONY: all all-dev clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check FORCE_MAKE
.PHONY: all all-dev clean distclean dist thesis viewthesis spine viewspine doc viewdoc cls check save savepdf test FORCE_MAKE

thesis: $(THESIS).pdf

Expand Down Expand Up @@ -51,6 +51,15 @@ viewthesis: thesis
viewspine: spine
$(LATEXMK) -pv $(SPINE)

save:
bash testfiles/save.sh

savepdf:
bash testfiles/save-pdf.sh

test:
l3build check

clean:
$(LATEXMK) -c $(PACKAGE).dtx $(THESIS) $(SPINE)
-@$(RM) *~
Expand Down
26 changes: 26 additions & 0 deletions build.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env texlua

module = "thuthesis"

supportdir = "./testfiles/support-main"

checksuppfiles = {"fontset.tex"}
demofiles = {"main.tex", "thuthesis.sty", "data", "figures", "ref"}
installfiles = {"*.cls", "*.bst", "tsinghua.pdf"}
sourcefiles = {"*.dtx", "*.ins", "*.bst", "tsinghua.pdf"}

checkengines = {"xetex"}
stdengine = "xetex"

checkconfigs = {
"build", "testfiles/config-cover", -- "testfiles/config-nomencl",
"testfiles/config-bib",
}

typesetexe = "xelatex"
unpackexe = "xetex"

checkopts = "-file-line-error -halt-on-error -interaction=nonstopmode"
typesetopts = "-file-line-error -halt-on-error -interaction=nonstopmode"

lvtext = ".tex"
25 changes: 25 additions & 0 deletions testfiles/01-cover/bachelor-english.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
\input{regression-test.tex}
\input{fontset.tex}
\documentclass[degree=bachelor]{thuthesis}

\thusetup{
language = english,
ctitle = {中国计算机科学研究生学术论文写作中引用行为的研究},
etitle = {Citation Behaviors of Chinese Computer Science Graduate Students in Research Paper Writing},
cdepartment = {外国语言文学系},
cmajor = {英语语言文学},
cauthor = {姚沛然},
csupervisor = {颜奕\hskip0.6cm 副教授},
cdate = {2019 年 7 月 1 日},
}

\begin{document}
\START
\showoutput

\makeatletter
\thu@first@titlepage

\clearpage
\OMIT
\end{document}
Loading

0 comments on commit 9e14596

Please sign in to comment.