Commit 98b6c3b4 authored by liziwl's avatar liziwl
Browse files

fix(test): make biber example build succeed

Only uncomment one biblatex line so the package is not loaded twice, and
remove the BibTeX .bbl left by earlier builds that biblatex rejects.
parent eb4ac729
Loading
Loading
Loading
Loading
+2 −2
Changes for test/test-files.py: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ def comment_line(filename, pattern, action):
                        if action:
                            line = f"% {line}"
                        else:
                            line = re.sub("^[%\s]+", "", line)
                            line = re.sub(r"^[%\s]+", "", line)
                        f2.write(line)
                        print(line)
                    else:
@@ -118,7 +118,7 @@ if __name__ == "__main__":
        if not args.undo:
            comment_line(filename, "{natbib}", True)
            comment_line(filename, "bibliographystyle{sustechthesis-numeric}", True)
            comment_line(filename, "gb7714-2015,.*{biblatex}", False)
            comment_line(filename, r"style=gb7714-2015,gbalign=left\]{biblatex}", False)
            comment_line(filename, "addbibresource{ref/refs.bib}", False)
    elif args.recipe in REPORT_TYPES:
        # 4: progress, 5: proposal, 6: practice
+2 −0
Changes for test/test.sh: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,8 @@ cp "$RT_DIR/sustechthesis-example.pdf" "$RT_DIR/public-test/sustechthesis-exampl
python3 "$RT_DIR/test/test-files.py" --recipe 2 --undo

# 生成biber预览
# BibTeX 生成的 .bbl 会导致 biblatex 报错
rm -f "$RT_DIR/sustechthesis-example.bbl"
python3 "$RT_DIR/test/test-files.py" --recipe 3
make
cp "$RT_DIR/sustechthesis-example.pdf" "$RT_DIR/public-test/sustechthesis-example-biber.pdf"