Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor rm -rf from testsuite script #2664

Merged
merged 7 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ add_custom_target( installcheck
COMMAND ${CMAKE_COMMAND} -E env
${CMAKE_INSTALL_FULL_DATADIR}/testsuite/do_tests.sh
--prefix=${CMAKE_INSTALL_PREFIX}
--report-dir="${PROJECT_BINARY_DIR}/reports"
${TEST_OPTS}
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
COMMENT "Executing NEST's testsuite..."
Expand Down
20 changes: 5 additions & 15 deletions testsuite/do_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,10 @@ usage ()
fi

cat <<EOF
Usage: $0 --prefix=<path> --report-dir=<path> [options]
Usage: $0 --prefix=<path> [options]

Required arguments:
--prefix=<path> The base installation path of NEST
--report-dir=<path> The directory to store the output to

Options:
--with-python=<exe> The Python executable to use
Expand All @@ -66,7 +65,6 @@ EOF
}

PREFIX=""
REPORTDIR=""
PYTHON=""
MUSIC=""
while test $# -gt 0 ; do
Expand All @@ -77,9 +75,6 @@ while test $# -gt 0 ; do
--prefix=*)
PREFIX="$( echo "$1" | sed 's/^--prefix=//' )"
;;
--report-dir=*)
REPORTDIR="$( echo "$1" | sed 's/^--report-dir=//' )"
;;
--with-python=*)
PYTHON="$( echo "$1" | sed 's/^--with-python=//' )"
;;
Expand All @@ -97,10 +92,6 @@ if test ! "${PREFIX:-}"; then
usage 2 "--prefix";
fi

if test ! "${REPORTDIR:-}"; then
usage 2 "--report-dir";
fi

if test "${PYTHON}"; then
TIME_LIMIT=120 # seconds, for each of the Python tests
PYTEST_VERSION="$(${PYTHON} -m pytest --version --timeout ${TIME_LIMIT} --numprocesses=1 2>&1)" || {
Expand All @@ -121,12 +112,11 @@ fi
. "$(dirname $0)/junit_xml.sh"
. "$(dirname $0)/run_test.sh"

if test -d "${REPORTDIR}"; then
rm -rf "${REPORTDIR}"
fi
mkdir "${REPORTDIR}"

TEST_BASEDIR="${PREFIX}/share/nest/testsuite"

# create the report dir
REPORTDIR="$(mktemp -d -p $TEST_BASEDIR test_report_XXX)"

TEST_LOGFILE="${REPORTDIR}/installcheck.log"
TEST_OUTFILE="${REPORTDIR}/output.log"
TEST_RETFILE="${REPORTDIR}/output.ret"
Expand Down