From 935494429d1a1ab9f7917cdd5a17a807855488ba Mon Sep 17 00:00:00 2001 From: Alberto Bertogli Date: Sun, 25 Sep 2016 20:48:21 +0100 Subject: [PATCH] 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. --- test/util/lib.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/util/lib.sh b/test/util/lib.sh index f876039..40b16cb 100644 --- a/test/util/lib.sh +++ b/test/util/lib.sh @@ -10,6 +10,10 @@ function init() { export UTILDIR="$(realpath ${TBASE}/../util/)" + if [ "${RACE}" == "1" ]; then + RACE="-race" + fi + # Remove the directory where test-mda will deliver mail, so previous # runs don't interfere with this one. rm -rf .mail @@ -31,7 +35,7 @@ function chasquid() { HOSTALIASES=${TBASE}/hosts \ PATH=${UTILDIR}:${PATH} \ MDA_DIR=${TBASE}/.mail \ - go run ${TBASE}/../../chasquid.go "$@" + go run ${RACE} ${TBASE}/../../chasquid.go "$@" } function add_user() {