Skip to content

Commit ae28957

Browse files
test: Move make doc into `test.py
`make doc` is more complicated than templates. Testing templates should not depend on `make doc`.
1 parent 6f8a9f7 commit ae28957

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ clean-dist:
5858
clean-all: clean clean-dist FORCE_MAKE
5959

6060
.PHONY: test
61-
test: doc copy FORCE_MAKE
61+
test: copy FORCE_MAKE
6262
SCAFFOLDDIR=$(SCAFFOLDDIR) TESTDIR=$(TESTDIR) \
6363
python scripts/test.py
6464

scripts/test.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class TestCase:
3535
icon: str
3636
directory: Path
3737
name: str
38+
args: list[str]
3839
env: dict[str, str] | None = None
3940

4041
def __init__(
@@ -44,11 +45,13 @@ def __init__(
4445
/,
4546
*,
4647
name: str | None = None,
48+
args: list[str] = ["latexmk"],
4749
env: dict[str, str] | None = None,
4850
) -> None:
4951
self.icon = icon
5052
self.directory = directory
5153
self.name = name or directory.name
54+
self.args = args
5255
self.env = env
5356

5457
def execute(self) -> CalledProcessError | None:
@@ -57,7 +60,7 @@ def execute(self) -> CalledProcessError | None:
5760
assert self.directory.exists()
5861
try:
5962
run(
60-
["latexmk"],
63+
self.args,
6164
cwd=self.directory,
6265
# Append to the original env
6366
env=None if self.env is None else {**environ, **self.env},
@@ -82,6 +85,7 @@ def execute(self) -> CalledProcessError | None:
8285
TestCase(
8386
"📖", ROOT_DIR / "handbook", name="graduate-handbook", env={"GRADUATE": "true"}
8487
),
88+
TestCase("📖", ROOT_DIR, name="bithesis.pdf", args=["make", "doc"]),
8589
]
8690

8791
# Execute all test cases, and raise the first error.

0 commit comments

Comments
 (0)