Create checklang tox.ini target

Create target to test that localized manuals are actually building.

Change-Id: Ia9ad298c4e9ee24f774e986d46c3c370d6046376
This commit is contained in:
Andreas Jaeger 2014-05-15 16:43:56 -04:00
parent ab7ad80358
commit 6bb3b8f57a
2 changed files with 45 additions and 0 deletions

37
tools/test-languages.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/bash
function setup_directory {
SET_LANG=$1
shift
for BOOK_DIR in "$@" ; do
openstack-generate-docbook -l $SET_LANG -b $BOOK_DIR
done
}
function test_manuals {
SET_LANG=$1
shift
for BOOK in "$@" ; do
echo "Building $BOOK for language $SET_LANG..."
setup_directory $SET_LANG $BOOK
openstack-doc-test --check-build -l $SET_LANG --only-book $BOOK
RET=$?
if [ "$RET" -eq "0" ] ; then
echo "... succeeded"
else
echo "... failed"
BUILD_FAIL=1
fi
done
}
function test_all {
test_manuals 'ja' 'openstack-ops'
}
BUILD_FAIL=0
test_all
exit $BUILD_FAIL

View File

@ -33,6 +33,14 @@ commands = openstack-doc-test --check-build {posargs}
# over.
commands = openstack-doc-test --check-build --nocreate-index --force
[testenv:checklang]
# Generatedocbook needs xml2po which cannot be installed
# in the venv. Since it's installed in the system, let's
# use sitepackages.
sitepackages=True
whitelist_externals = bash
commands = bash tools/test-languages.sh
[testenv:buildlang]
# Run as "tox -e buildlang -- $LANG"
# Generatedocbook needs xml2po which cannot be installed