Skip to content

Commit 2cbe1dd

Browse files
committed
Include documentation build in coverage
Some of stgit's code is used exclusively during the documentation build process; specifically for generating asciidoc .txt files. The stg-build tool is modified so that, like stg, coverage data will be captured when the COVERAGE_PROCESS_START env variable is set. A new build-txt target is added to Documentation/Makefile so that stg-build can be invoked, but without needing to invoke asciidoc itself as the html and man targets do. This avoids needing to install asciidoc in the CI environment. Signed-off-by: Peter Grayson <[email protected]>
1 parent c43bd65 commit 2cbe1dd

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

Documentation/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ doc.dep : $(wildcard *.txt) build-docdep.perl
6060
clean:
6161
rm -f *.xml *.html *.pdf *.1 doc.dep $(COMMANDS_TXT) command-list.txt
6262

63+
build-txt: $(COMMANDS_TXT) command-list.txt
64+
6365
ALL_PY = $(shell find ../stgit -name '*.py')
6466

6567
$(COMMANDS_TXT): $(ALL_PY)

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ coverage-test:
5757
COVERAGE_PROCESS_START=$(PWD)/.coveragerc \
5858
COVERAGE_FILE=$(PWD)/.cov-files/.coverage \
5959
$(MAKE) -C t all
60+
COVERAGE_PROCESS_START=$(PWD)/.coveragerc \
61+
COVERAGE_FILE=$(PWD)/.cov-files/.coverage \
62+
$(MAKE) -C Documentation build-txt
6063
$(PYTHON) -m coverage combine .cov-files/.coverage.*
6164
rm -r .cov-files
6265

stg-build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ from __future__ import (
99
)
1010

1111
import optparse
12+
import os
1213
import sys
1314

1415
from stgit import argparse, commands
@@ -71,4 +72,9 @@ def main():
7172

7273

7374
if __name__ == '__main__':
75+
if os.environ.get('COVERAGE_PROCESS_START'):
76+
import coverage
77+
78+
coverage.process_startup()
79+
7480
main()

0 commit comments

Comments
 (0)