docs: conf.py: check return code when calling os.system

Several calls were made but results were not checked, obfuscating the
errors.
This commit is contained in:
Ivan Grokhotkov 2018-06-21 15:22:47 +08:00
parent 26e1136fc5
commit b17defd6cb

View file

@ -32,22 +32,28 @@ if 'BUILDDIR' in os.environ:
# Call Doxygen to get XML files from the header files
print("Calling Doxygen to generate latest XML files")
os.system("doxygen ../Doxyfile")
if os.system("doxygen ../Doxyfile") != 0:
raise RuntimeError('Doxygen call failed')
# Doxygen has generated XML files in 'xml' directory.
# Copy them to 'xml_in', only touching the files which have changed.
copy_if_modified('xml/', 'xml_in/')
# Generate 'api_name.inc' files using the XML files by Doxygen
os.system('python ../gen-dxd.py')
if os.system('python ../gen-dxd.py') != 0:
raise RuntimeError('gen-dxd.py failed')
# Generate 'kconfig.inc' file from components' Kconfig files
kconfig_inc_path = '{}/inc/kconfig.inc'.format(builddir)
os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in')
if os.system('python ../gen-kconfig-doc.py > ' + kconfig_inc_path + '.in') != 0:
raise RuntimeError('gen-kconfig-doc.py failed')
copy_if_modified(kconfig_inc_path + '.in', kconfig_inc_path)
# Generate 'esp_err_defs.inc' file with ESP_ERR_ error code definitions
esp_err_inc_path = '{}/inc/esp_err_defs.inc'.format(builddir)
os.system('python ../../tools/gen_esp_err_to_name.py --rst_output ' + esp_err_inc_path + '.in')
if os.system('python ../../tools/gen_esp_err_to_name.py --rst_output ' + esp_err_inc_path + '.in') != 0:
raise RuntimeError('gen_esp_err_to_name.py failed')
copy_if_modified(esp_err_inc_path + '.in', esp_err_inc_path)
# http://stackoverflow.com/questions/12772927/specifying-an-online-image-in-sphinx-restructuredtext-format