mirror of https://github.com/CGAL/cgal
107 lines
3.3 KiB
Bash
107 lines
3.3 KiB
Bash
#!/bin/bash
|
|
if [ "$1" == '--help' ]; then
|
|
echo "Usage: $0 <doxygen_1> [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"
|
|
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."
|
|
echo "$0 --help for more information."
|
|
exit 0
|
|
fi
|
|
|
|
#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 -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 [ -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
|
|
MASTER_DESCRIBE=$(git describe --tags)
|
|
mkdir build
|
|
cd build
|
|
cmake .. &> /dev/null
|
|
make -j$NB_CORES &> /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 -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
|
|
#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 -j$NB_CORES doc &> /dev/null
|
|
make -j$NB_CORES doc &> /dev/null
|
|
cd .. #scripts
|
|
#get VERSION's content
|
|
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
|
|
|
|
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 [ -z $PATH_TO_2 ]; then
|
|
rm -rf ./doxygen_master
|
|
fi
|