build: fix ns3 sphinx targets and test-ns3.py tests

This commit is contained in:
Gabriel Ferreira
2022-02-11 22:47:03 -03:00
parent b6b8bfbaad
commit 9fcdbd08d2
3 changed files with 11 additions and 7 deletions

View File

@@ -942,11 +942,13 @@ macro(process_options)
add_custom_target(sphinx COMMENT "Building sphinx documents")
function(sphinx_target targetname)
# cmake-format: off
add_custom_target(
sphinx_${targetname} COMMAND make SPHINXOPTS=-N -k html singlehtml
latexpdf
sphinx_${targetname}
COMMAND make SPHINXOPTS=-N -k html singlehtml latexpdf
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/doc/${targetname}
)
# cmake-format: on
add_dependencies(sphinx sphinx_${targetname})
endfunction()
sphinx_target(manual)

2
ns3
View File

@@ -827,7 +827,7 @@ def build_step(args,
target = get_target_to_build(target, ns3_version, build_profile)
else:
# Sphinx target should have the sphinx prefix
if target in ["manual", "models", "tutorial"]:
if target in ["contributing", "manual", "models", "tutorial"]:
target = "sphinx_%s" % target
# Docs should build both doxygen and sphinx based docs

View File

@@ -1588,14 +1588,16 @@ class NS3ExpectedUseTestCase(NS3BaseTestCase):
doc_folder = os.path.abspath(os.sep.join([".", "doc"]))
# First we need to clean old docs, or it will not make any sense.
for target in ["manual", "models", "tutorial"]:
# For each sphinx doc target.
for target in ["contributing", "manual", "models", "tutorial"]:
# First we need to clean old docs, or it will not make any sense.
doc_build_folder = os.sep.join([doc_folder, target, "build"])
doc_temp_folder = os.sep.join([doc_folder, target, "source-temp"])
if os.path.exists(doc_build_folder):
shutil.rmtree(doc_build_folder)
if os.path.exists(doc_temp_folder):
shutil.rmtree(doc_temp_folder)
# For each sphinx doc target.
for target in ["manual", "models", "tutorial"]:
# Build
return_code, stdout, stderr = run_ns3("docs %s" % target)
self.assertEqual(return_code, 0)