travis-ci: check AsciiDoc/AsciiDoctor stderr output
`make` does not necessarily fail with an error code if Asciidoc/AsciiDoctor encounters problems. Anything written to stderr might be a better indicator for problems. Ensure that nothing is written to stderr during a documentation build. The redirects do not work in `sh`, therefore the script uses `bash`. This shouldn't be a problem as the script is only executed on TravisCI. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider committed
Apr 26, 2017 at 21:15 UTC
505ad91304e1793ee588ccdcc2413c2e0af6f667
1 file changed
+6
-3
ci/test-documentation.sh
+6
-3
@@ -1,4 +1,4 @@
1
-#!/bin/sh
1
+#!/usr/bin/env bash
2
#
3
# Perform sanity checks on documentation and build it.
4
#
@@ -9,7 +9,8 @@ make check-builtins
9
make check-docs
10
11
# Build docs with AsciiDoc
12
-make --jobs=2 doc
12
+make --jobs=2 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
13
+! test -s stderr.log
14
test -s Documentation/git.html
15
test -s Documentation/git.xml
16
test -s Documentation/git.1
@@ -17,6 +18,8 @@ grep '<meta name="generator" content="AsciiDoc ' Documentation/git.html
18
19
# Build docs with AsciiDoctor
20
make clean
20
-make --jobs=2 USE_ASCIIDOCTOR=1 doc
21
+make --jobs=2 USE_ASCIIDOCTOR=1 doc > >(tee stdout.log) 2> >(tee stderr.log >&2)
22
+sed '/^GIT_VERSION = / d' stderr.log
23
+! test -s stderr.log
24
test -s Documentation/git.html
25
grep '<meta name="generator" content="Asciidoctor ' Documentation/git.html