Skip to content

Commit

Permalink
Attempt to fix tools/run_doxygen.sh for travis-ci
Browse files Browse the repository at this point in the history
This works well locally, but travis-ci fails with
```
# Examine log file for remaining warnings/errors
warnings=$(grep "warning\|error" ${log})
grep "warning\|error" ${log}
makefile:260: recipe for target 'doc' failed
make: *** [doc] Error 1
The command "make doc" exited with 2.
```

It is not clear to me why `grep "warning\|error" ${log}` would exit with code 2. As an attempt, I catch grep's stderr and assign it to `warnings` as well.
It is also not clear whether or not travis-ci expects that this script (called by `make doc`) should define an exit value if we got warnings (see https://docs.travis-ci.com/user/job-lifecycle#how-does-this-work-or-why-you-should-not-use-exit-in-build-steps).
  • Loading branch information
dschlaep committed Jul 25, 2019
1 parent e299743 commit 6f6a058
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions tools/run_doxygen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@
# Create documentation using doxygen and report any errors/warnings except
# those warnings/errors listed as exceptions (doc/doxygen_exceptions.txt)

doc_path="doc" # path to documentation
doxy=${doc_path}"/Doxyfile" # Doxyfile
log=${doc_path}"/log_doxygen.log" # logfile for doxygen output
log_tmp=${doc_path}"/log_doxygen_tmp.log"
doxexcept=${doc_path}"/doxygen_exceptions.txt" # filename that lists exceptions (one per line)


# Don't use set if run locally, e.g., with `make doc`
if [ ${CI} ]; then
Expand All @@ -17,10 +11,16 @@ if [ ${CI} ]; then
# The -v flag makes the shell print all lines in the script before executing them
fi


doc_path="doc" # path to documentation
doxy=${doc_path}"/Doxyfile" # Doxyfile
log=${doc_path}"/log_doxygen.log" # logfile for doxygen output
log_tmp=${doc_path}"/log_doxygen_tmp.log"
doxexcept=${doc_path}"/doxygen_exceptions.txt" # filename that lists exceptions (one per line)

# Downgrade Doxyfile in case this runs an old doxygen version, e.g.,
# travis-ci is currently on 1.8.6 (instead of 1.8.15)
if [[ $(doxygen --version) != "1.8.15" ]]
then
if [[ $(doxygen --version) != "1.8.15" ]]; then
doxygen -u ${doxy} &>/dev/null
fi

Expand All @@ -41,8 +41,9 @@ fi


# Examine log file for remaining warnings/errors
warnings=$(grep "warning\|error" ${log})
warnings=$(grep "warning\|error" ${log} 2>&1)

if [ -n "${warnings}" ]; then
echo ${warnings}
exit 1
fi

0 comments on commit 6f6a058

Please sign in to comment.