From f3697f1b2b320e4908e93c5caf3a9c3e2c499db5 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 9 Jul 2019 13:09:09 +0200 Subject: [PATCH] Move logging functions in the script to avoid having to ask for CGAL-I before it is set. --- .../autotest_cgal_with_ctest | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/Scripts/developer_scripts/autotest_cgal_with_ctest b/Scripts/developer_scripts/autotest_cgal_with_ctest index cd954740e7d..51a130ad31b 100755 --- a/Scripts/developer_scripts/autotest_cgal_with_ctest +++ b/Scripts/developer_scripts/autotest_cgal_with_ctest @@ -35,6 +35,34 @@ export INSTALLATION_DIR="" export TESTSUITE_DIR="" USE_LATEST_UNZIPPED="" +# ---------------------------------------------------------------------------------------- +# Logging functions +# ---------------------------------------------------------------------------------------- +log() +{ + LOGFILE=${1} + shift + if [ -n "${CONSOLE_OUTPUT}" ]; then + printf "${*} ...\n" + fi + printf "\n-------------------------------------------------------\n" >> "${LOGFILE}" + printf " ${*} ...\n" >> "${LOGFILE}" + printf "\n-------------------------------------------------------\n" >> "${LOGFILE}" +} + +log_done() +{ + if [ -n "${CONSOLE_OUTPUT}" ]; then + printf \ + " done\n-------------------------------------------------------\n" + fi + printf "\n-------------------------------------------------------\n" >> "${1}" + printf " **DONE**\n" >> "${1}" + printf "\n-------------------------------------------------------\n" >> "${1}" +} + + + # ---------------------------------------------------------------------------------------- # Downloads the file "LATEST" whose contents indicates which release to test # ---------------------------------------------------------------------------------------- @@ -202,13 +230,6 @@ else exit 1 fi -if [ -n "${SCRIPTS_DIR}" ]; then - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-git"` -else - CGAL_DIR=`readlink "${CGAL_ROOT}/CGAL-I"` -fi - -source "${CGAL_DIR}/${SCRIPTS_DIR}developer_scripts/log.sh" LOGS_DIR="${CGAL_ROOT}/AUTOTEST_LOGS" LOCK_FILE="${CGAL_ROOT}/autotest_cgal_with_cmake.lock"