1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2025-12-17 14:37:02 +00:00

test: Add RACE=1 variable to run with the race detector

It's often useful to run the tests with the race detector (-race) enabled.
Unfortunately, building with it is too slow to enable unconditionally.

So for now this patch adds an option, in the form of an environment variable,
to enable it manually.
This commit is contained in:
Alberto Bertogli
2016-09-25 20:48:21 +01:00
parent 1433340ea6
commit 935494429d

View File

@@ -10,6 +10,10 @@ function init() {
export UTILDIR="$(realpath ${TBASE}/../util/)" export UTILDIR="$(realpath ${TBASE}/../util/)"
if [ "${RACE}" == "1" ]; then
RACE="-race"
fi
# Remove the directory where test-mda will deliver mail, so previous # Remove the directory where test-mda will deliver mail, so previous
# runs don't interfere with this one. # runs don't interfere with this one.
rm -rf .mail rm -rf .mail
@@ -31,7 +35,7 @@ function chasquid() {
HOSTALIASES=${TBASE}/hosts \ HOSTALIASES=${TBASE}/hosts \
PATH=${UTILDIR}:${PATH} \ PATH=${UTILDIR}:${PATH} \
MDA_DIR=${TBASE}/.mail \ MDA_DIR=${TBASE}/.mail \
go run ${TBASE}/../../chasquid.go "$@" go run ${RACE} ${TBASE}/../../chasquid.go "$@"
} }
function add_user() { function add_user() {