Browse Source

test: race detector doesn't work on armv7l

Test fails without this fix on armv7l:

    go test: -race is only supported on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64
Brandon Philips 10 years ago
parent
commit
1b894c6b0b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      test

+ 7 - 1
test

@@ -45,7 +45,13 @@ split=(${NO_RACE_TEST// / })
 NO_RACE_TEST=${split[@]/#/${REPO_PATH}/}
 
 echo "Running tests..."
-go test -timeout 3m ${COVER} $@ ${TEST} --race -cpu 1,2,4
+
+MACHINE_TYPE=$(uname -m)
+if [ $MACHINE_TYPE != "armv7l" ]; then
+  RACE="--race"
+fi
+
+go test -timeout 3m ${COVER} $@ ${TEST} ${RACE} -cpu 1,2,4
 go test -timeout 3m ${COVER} $@ ${NO_RACE_TEST} -cpu 1,2,4
 
 if [ -n "$INTEGRATION" ]; then