From 36d1a39bfc9b7dbeea91e0926feacf42a6708bc1 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 7 Jun 2017 13:58:48 +0200 Subject: [PATCH] Optimisations : - Fix path problems - Unify test_doxygens.sh - use th emax number of cores available for make calls - fix doc of the scripts --- .../doc/scripts/compare_testsuites.sh | 7 ++ .../doc/scripts/test_doxygen_versions.sh | 64 +++++++++----- .../test_doxygen_versions_from_release.sh | 86 ------------------- .../developer_scripts/run_doxygen_testsuite | 2 +- 4 files changed, 49 insertions(+), 110 deletions(-) delete mode 100644 Documentation/doc/scripts/test_doxygen_versions_from_release.sh diff --git a/Documentation/doc/scripts/compare_testsuites.sh b/Documentation/doc/scripts/compare_testsuites.sh index 1afd0b672e1..ec4e941e451 100644 --- a/Documentation/doc/scripts/compare_testsuites.sh +++ b/Documentation/doc/scripts/compare_testsuites.sh @@ -1,4 +1,11 @@ #!/bin/bash +if [ "$1" == '--help' ]; then + echo "Usage: $0 [doc 2]" + exho "doc 1 and doc 2 are paths to doxygen outputs (doc_output)." + echo "Parse the xml output of doc 1 and creates a directory with organized text files." + echo "Then, if doc_2 is specified, do the same for its xml output and make the diff between them." + exit 0 +fi #Path to the CGAL_Documentation_build_directory/doc_output PATH_TO_DOC="$1" diff --git a/Documentation/doc/scripts/test_doxygen_versions.sh b/Documentation/doc/scripts/test_doxygen_versions.sh index 46afe71e114..1b435c88d77 100644 --- a/Documentation/doc/scripts/test_doxygen_versions.sh +++ b/Documentation/doc/scripts/test_doxygen_versions.sh @@ -1,20 +1,18 @@ #!/bin/bash -if [ "$1" == '--help' ]; then +if [ "$1" == '--help' ]; then echo "Usage: $0 [doxygen_2] [publish_dir]" echo "Compares the output of doxygen_1 and doxygen_2 of this CGAL version, " echo "where doxygen_1 and doxygen_2 are valid paths to doxygen executables." echo "If doxygen_2 is not specified, the master branch of doxygen will be cloned, built and used as doxygen_2." echo "publish_dir is the path to the dir where the testsuite results are kept" + echo "$0 must be called from doc/scripts" exit 0 fi #build reference PATH_TO_1="$1" PATH_TO_2="$2" -IS_ARG2=1 -PUBLISH_DIR="$4" -if [ -z $PATH_TO_2 ]; then - IS_ARG2=0 -fi +PUBLISH_DIR="$3" +NB_CORES="$(grep -c ^processor /proc/cpuinfo)" if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_TO_1 ]; then echo "Please specify a valid path to a doxygen executable." @@ -22,17 +20,30 @@ if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_ exit 0 fi -ROOT=$PWD/../../.. +#Find the CGAL directory. If there is a directory called Documentation, this is a branch build. +#Else it is from a release. +TEMP=$PWD +IS_RELEASE=1 +cd $PWD/../.. +if [ "$(basename $PWD)" = 'Documentation' ]; then + ROOT=$PWD/.. + IS_RELEASE=0 +else + ROOT=$PWD +fi +cd $TEMP #scripts + + mkdir ./build_doc cd ./build_doc cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null -make -j7 doc &> /dev/null +make -j$NB_CORES doc &> /dev/null cd ../ #scripts bash compare_testsuites.sh $PWD/build_doc/doc_output mv ./doc_data ./doc_ref #download and build doxygen_master -if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then +if [ -z $PATH_TO_2 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then echo "No second path detected. Cloning Doxygen master branch..." git clone https://github.com/doxygen/doxygen.git doxygen_master &> /dev/null cd doxygen_master @@ -40,7 +51,7 @@ if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_ mkdir build cd build cmake .. &> /dev/null - make -j7 &> /dev/null + make -j$NB_CORES &> /dev/null cd ../.. #scripts PATH_TO_2="$PWD/doxygen_master/build/bin/doxygen" echo "done." @@ -50,32 +61,39 @@ mv ./build_doc ./doc_dir mkdir build_doc cd ./build_doc cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_2" ../.. &> /dev/null -make -j7 doc &> /dev/null +make -j$NB_CORES doc &> /dev/null cd ../ #scripts DOXYGEN_1=$($PATH_TO_1 --version) DOXYGEN_2=$($PATH_TO_2 --version) -bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref $DOXYGEN_1 $DOXYGEN_2 -#rebuild doc with Doxygen_1 to get the right doc_tags without GENERATE_XML because it ignores the EXCLUDE_SYMBOLS, +bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref +#rebuild doc with Doxygen_1 to get the right doc_tags without GENERATE_XML because it ignores the EXCLUDE_SYMBOLS, #which disrupts the logs mv ./build_doc ./doc_master rm -rf ./doc_dir mkdir ./doc_dir cd ./doc_dir cmake -DCGAL_DOC_CREATE_LOGS=true -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null -make -j7 doc &> /dev/null -make -j7 doc &> /dev/null -cd .. +make -j$NB_CORES doc &> /dev/null +make -j$NB_CORES doc &> /dev/null +cd .. #scripts #get VERSION's content -cd $ROOT -mkdir -p ./build && cd ./build -cmake .. -CGAL_NAME="$(cat $PWD/VERSION)" +if [ $IS_RELEASE = 0 ]; then + cd $ROOT + mkdir -p ./build && cd ./build + cmake .. + CGAL_NAME="$(cat $PWD/VERSION)" + cd ..$ROOT + rm -rf ./build + cd $ROOT/Documentation/doc/scripts +else + CGAL_NAME="$(cat $ROOT/VERSION)" +fi #update overview -cd $ROOT/Documentation/doc/scripts + python ./testsuite.py --output-dir $PWD/doc_dir/doc_output/ --doc-log-dir $PWD/doc_dir/doc_log/ \ --publish $PUBLISH_DIR --diff $PWD/diff.txt --master-dir $PWD/doc_master/doc_output/ \ - --cgal-version "$CGAL_NAME" --do-copy-results --doxygen-version "$DOXYGEN_1" --master-describe "$MASTER_DESCRIBE" + --cgal-version "$CGAL_NAME" --do-copy-results --version-to-keep 10 --doxygen-version "$DOXYGEN_1" --master-describe "$MASTER_DESCRIBE" #clean-up rm -rf ./build_doc @@ -83,6 +101,6 @@ rm -rf ./doc_dir rm -rf ./doc_master rm -rf ./doc_ref rm -rf ./doc_data -if [ $IS_ARG2 == 0 ]; then +if [ -z $PATH_TO_2 ]; then rm -rf ./doxygen_master fi diff --git a/Documentation/doc/scripts/test_doxygen_versions_from_release.sh b/Documentation/doc/scripts/test_doxygen_versions_from_release.sh deleted file mode 100644 index e975ef06971..00000000000 --- a/Documentation/doc/scripts/test_doxygen_versions_from_release.sh +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -if [ "$1" == '--help' ]; then - echo "Usage: $0 [doxygen_2] [publish_dir]" - echo "Compares the output of doxygen_1 and doxygen_2 of this CGAL version, " - echo "where doxygen_1 and doxygen_2 are valid paths to doxygen executables." - echo "If doxygen_2 is not specified, the master branch of doxygen will be cloned, built and used as doxygen_2." - echo "publish_dir is the path to the dir where the testsuite results are kept" - exit 0 -fi -#build reference -PATH_TO_1="$1" -PATH_TO_2="$2" -IS_ARG2=1 -PUBLISH_DIR="$4" -if [ -z $PATH_TO_2 ]; then - IS_ARG2=0 -fi - -if [ -z $PATH_TO_1 ] || [ $(basename $PATH_TO_1) != "doxygen" ] || [ ! -e $PATH_TO_1 ]; then - echo "Please specify a valid path to a doxygen executable." - echo "$0 --help for more information." - exit 0 -fi - -ROOT=/home/cgal-testsuite -mkdir ./build_doc -cd ./build_doc -cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null -make -j7 doc &> /dev/null -cd ../ #scripts -bash compare_testsuites.sh $PWD/build_doc/doc_output -mv ./doc_data ./doc_ref - -#download and build doxygen_master -if [ $IS_ARG2 == 0 ] || [ $(basename $PATH_TO_2) != "doxygen" ] || [ ! -e $PATH_TO_2 ]; then - echo "No second path detected. Cloning Doxygen master branch..." - git clone https://github.com/doxygen/doxygen.git doxygen_master &> /dev/null - cd doxygen_master - MASTER_DESCRIBE=$(git describe --tags) - mkdir build - cd build - cmake .. &> /dev/null - make -j7 &> /dev/null - cd ../.. #scripts - PATH_TO_2="$PWD/doxygen_master/build/bin/doxygen" - echo "done." -fi -#build doc with doxygen master -mv ./build_doc ./doc_dir -mkdir build_doc -cd ./build_doc -cmake -DCGAL_GENERATE_XML=ON -DDOXYGEN_EXECUTABLE="$PATH_TO_2" ../.. &> /dev/null -make -j7 doc &> /dev/null -cd ../ #scripts -DOXYGEN_1=$($PATH_TO_1 --version) -DOXYGEN_2=$($PATH_TO_2 --version) -bash ./compare_testsuites.sh $PWD/build_doc/doc_output $PWD/doc_ref $DOXYGEN_1 $DOXYGEN_2 -#rebuild doc with Doxygen_1 to get the right doc_tags without GENERATE_XML because it ignores the EXCLUDE_SYMBOLS, -#which disrupts the logs -mv ./build_doc ./doc_master -rm -rf ./doc_dir -mkdir ./doc_dir -cd ./doc_dir -cmake -DCGAL_DOC_CREATE_LOGS=true -DDOXYGEN_EXECUTABLE="$PATH_TO_1" ../.. &> /dev/null -make -j7 doc &> /dev/null -make -j7 doc &> /dev/null -cd .. -#get VERSION's content -cd $ROOT -CGAL_NAME="$(cat $PWD/VERSION)" - -#update overview -cd $ROOT/doc/scripts -python ./testsuite.py --output-dir $PWD/doc_dir/doc_output/ --doc-log-dir $PWD/doc_dir/doc_log/ \ - --publish $PUBLISH_DIR --diff $PWD/diff.txt --master-dir $PWD/doc_master/doc_output/ \ - --cgal-version "$CGAL_NAME" --do-copy-results --version-to-keep 10 --doxygen-version "$DOXYGEN_1" --master-describe "$MASTER_DESCRIBE" - -#clean-up -rm -rf ./build_doc -rm -rf ./doc_dir -rm -rf ./doc_master -rm -rf ./doc_ref -rm -rf ./doc_data -if [ $IS_ARG2 == 0 ]; then - rm -rf ./doxygen_master -fi diff --git a/Scripts/developer_scripts/run_doxygen_testsuite b/Scripts/developer_scripts/run_doxygen_testsuite index b2862d85d74..f533e2d5f36 100755 --- a/Scripts/developer_scripts/run_doxygen_testsuite +++ b/Scripts/developer_scripts/run_doxygen_testsuite @@ -63,7 +63,7 @@ export PYTHONPATH PATH=/home/cgal-testsuite/local/bin:$PATH export PATH cd "$PWD/doc/scripts" -bash ./test_doxygen_versions_from_release.sh /home/cgal-testsuite/local/bin/doxygen '' '' /srv/CGAL/www/Members/Manual_doxygen_test +bash ./test_doxygen_versions.sh /home/cgal-testsuite/local/bin/doxygen '' /srv/CGAL/www/Members/Manual_doxygen_test case "$CGAL_RELEASE_ID" in *-I-*) ln -snf "../Manual_doxygen_test/$CGAL_RELEASE_ID/output" /srv/CGAL/www/doc/master ;;