forked from CGAL/cgal-testsuite-dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-testsuite.sh
executable file
·87 lines (72 loc) · 2.99 KB
/
run-testsuite.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
set -e
if [ -z "${CGAL_TEST_PLATFORM}" ]; then
export CGAL_TEST_PLATFORM="${HOSTNAME}"
echo "CGAL_TEST_PLATFORM not set. Using HOSTNAME:${HOSTNAME}"
fi
# HACK: We depend on this line to easily extract the platform name
# from the logs.
echo "CGAL_TEST_PLATFORM=${CGAL_TEST_PLATFORM}"
if [ -z "${CGAL_NUMBER_OF_JOBS}" ]; then
CGAL_NUMBER_OF_JOBS=1
echo "CGAL_NUMBER_OF_JOBS not set. Defaulting to 1."
else
echo "CGAL_NUMBER_OF_JOBS is ${CGAL_NUMBER_OF_JOBS}."
fi
declare -a "CGAL_CMAKE_FLAGS=${CGAL_CMAKE_FLAGS}"
echo "CGAL_CMAKE_FLAGS is ${CGAL_CMAKE_FLAGS[@]}."
# The directory where the release is stored.
export CGAL_RELEASE_DIR="/mnt/testsuite/"
# Directory where CGAL sources are stored.
CGAL_SRC_DIR="${CGAL_RELEASE_DIR}src/"
# Directory where CGAL tests are stored.
CGAL_TEST_DIR="${CGAL_RELEASE_DIR}test/"
# Directory where CGAL data are stored.
CGAL_DATA_DIR="${CGAL_RELEASE_DIR}data/"
# The directory where testresults are stored.
CGAL_TESTRESULTS="/mnt/testresults/"
# The actual logfile.
CGAL_LOG_FILE="${CGAL_TESTRESULTS}${CGAL_TEST_PLATFORM}"
# The directory of the build tree. The layout is so convoluted so
# satisfy collect_cgal_testresults_from_cmake.
#
# It assumes the build directory containing CMakeCache.txt,
# include/CGAL/compiler_config.h, etc. to be the parent directory.
CGAL_DIR="$HOME/build/src/cmake/platforms/${CGAL_TEST_PLATFORM}/"
CGAL_SRC_BUILD_DIR="${CGAL_DIR}"
CGAL_TEST_BUILD_DIR="$HOME/build/src/cmake/platforms/${CGAL_TEST_PLATFORM}/test/"
export CGAL_DIR
export CGAL_TEST_PLATFORM
export CGAL_DATA_DIR
# Create the binary directories
if [ ! -d "${CGAL_SRC_BUILD_DIR}" ]; then
mkdir -p "${CGAL_SRC_BUILD_DIR}"
fi
if [ ! -d "${CGAL_TEST_BUILD_DIR}" ]; then
mkdir -p "${CGAL_TEST_BUILD_DIR}"
fi
# Build CGAL. The CGAL_CMAKE_FLAGS used here will affect all other
# builds using this binary directory.
cd "${CGAL_SRC_BUILD_DIR}"
if [ -n "$DOCKERFILE_URL" ]; then
echo "Docker image built from ${DOCKERFILE_URL}" | tee "installation.log"
else
echo "Docker container" > installation.log
fi
cmake ${INIT_FILE:+"-C${INIT_FILE}"} -DRUNNING_CGAL_AUTO_TEST=TRUE \
"${CGAL_CMAKE_FLAGS[@]}" "${CGAL_RELEASE_DIR}" 2>&1 | tee -a "installation.log"
make VERBOSE=ON -k -fMakefile 2>&1 | tee -a "installation.log"
# Build and Execute the Tests
# We need to make a copy of the whole test dir because the current
# scripts don't allow out of source builds.
cp -r "${CGAL_TEST_DIR}/." "${CGAL_TEST_BUILD_DIR}"
cd "${CGAL_TEST_BUILD_DIR}"
make -j ${CGAL_NUMBER_OF_JOBS} -k -fmakefile2
# Copy version.h, so that collect_cgal_testresults_from_cmake can find it.
mkdir -p "$HOME/build/src/include/CGAL"
cp "${CGAL_RELEASE_DIR}/include/CGAL/version.h" "$HOME/build/src/include/CGAL"
cp "${CGAL_RELEASE_DIR}"/.scm* "$HOME/build/src/"
./collect_cgal_testresults_from_cmake
# Those are the files generated by collect_cgal_testresults_from_cmake.
cp "results_${CGAL_TESTER}_${CGAL_TEST_PLATFORM}.tar.gz" "results_${CGAL_TESTER}_${CGAL_TEST_PLATFORM}.txt" \
"${CGAL_TESTRESULTS}/"