X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fbash%2Ffunction%2Fdocs.sh;h=cb3f36d21a5b92e9b1aa7d3da17cc892c9489ba2;hp=be3f9861ceade4e1e5d74843db551959882cf20a;hb=e82ebbd96e2ba73276e2f1b6d7f9c2d8a9442c3f;hpb=aa72d4256fb7409fa01a0cb33aaa763128f0d30b diff --git a/resources/libraries/bash/function/docs.sh b/resources/libraries/bash/function/docs.sh index be3f9861ce..cb3f36d21a 100644 --- a/resources/libraries/bash/function/docs.sh +++ b/resources/libraries/bash/function/docs.sh @@ -47,12 +47,13 @@ function generate_docs () { pushd "${TOOLS_DIR}"/doc_gen || die "Pushd failed!" - WORKING_DIR="tmp" BUILD_DIR="_build" # Remove the old build: rm -rf ${BUILD_DIR} || true - rm -rf ${WORKING_DIR} || true + rm -rf /tmp/tmp-csit* || true + + export WORKING_DIR=$(mktemp -d /tmp/tmp-csitXXX) || die "export failed" # Create working directories mkdir -p "${BUILD_DIR}" || die "Mkdir failed!" @@ -81,17 +82,15 @@ function generate_docs () { die "Touch index.robot file failed!" } - # Due to hoststack tests having dots in the name of suite, tests will become - # disabled as spihnxdoc cannot properly work with the path. gen_rst - # is generating dots scheme. The solution is to rename suites as - # having dots is misleading with robot framework naming conventions. - - #from_dir="${CSIT_DIR}/tests/" - #to_dir="${WORKING_DIR}/tests/" - #dirs="${from_dir} ${to_dir}" - #rsync -ar --include='*/' --include '*.robot' --exclude '*' ${dirs} || { - # die "rSync failed!" - #} + from_dir="${CSIT_DIR}/tests/" + to_dir="${WORKING_DIR}/tests/" + dirs="${from_dir} ${to_dir}" + rsync -ar --include='*/' --include '*.robot' --exclude '*' ${dirs} || { + die "rSync failed!" + } + + # to remove GPL licence section + find "${WORKING_DIR}/tests/" -type f -exec sed -i '/\*\*\*/,$!d' {} \; find ${WORKING_DIR}/ -type d -exec echo {} \; -exec touch {}/__init__.py \;