Skip to content

Commit

Permalink
run_test: WARPX_CI_TMP
Browse files Browse the repository at this point in the history
Allow to use a fixed instead of a unique temporary directory.
This will help `ccache` to cache compliation, because absolute
paths do not change anymore between builds.
  • Loading branch information
ax3l committed Dec 4, 2021
1 parent 0f0823a commit 9ea3876
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ tests_run=${tests_arg:+--tests=${tests_arg}}
# Remove contents and link to a previous test directory (intentionally two arguments)
rm -rf test_dir/* test_dir
# Create a temporary test directory
tmp_dir=$(mktemp --help >/dev/null 2>&1 && mktemp -d -t ci-XXXXXXXXXX || mktemp -d "${TMPDIR:-/tmp}"/ci-XXXXXXXXXX)
if [ $? -ne 0 ]; then
echo "Cannot create temporary directory"
exit 1
if [ -z "${WARPX_CI_TMP}" ]; then
tmp_dir=$(mktemp --help >/dev/null 2>&1 && mktemp -d -t ci-XXXXXXXXXX || mktemp -d "${TMPDIR:-/tmp}"/ci-XXXXXXXXXX)
if [ $? -ne 0 ]; then
echo "Cannot create temporary directory"
exit 1
fi
else
tmp_dir=${WARPX_CI_TMP}
fi

# Copy WarpX into current test directory
mkdir ${tmp_dir}/warpx
rm -rf ${tmp_dir}/warpx
mkdir -p ${tmp_dir}/warpx
cp -r ./* ${tmp_dir}/warpx

# Link the test directory
Expand Down

0 comments on commit 9ea3876

Please sign in to comment.