From 62a1a561cf3c746d49a58065577259b6246ad4d0 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 20 Jun 2020 14:51:27 +0100 Subject: [PATCH] build: test-repeat.sh add -tag to buildflags --- bin/test-repeat.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/test-repeat.sh b/bin/test-repeat.sh index 39f395335..1899a3f27 100755 --- a/bin/test-repeat.sh +++ b/bin/test-repeat.sh @@ -1,7 +1,7 @@ #!/bin/bash # defaults -race="" +buildflags="" binary="test.binary" flags="" iterations="100" @@ -29,6 +29,8 @@ Flags this script understands the log files generated will start with NAME (default ${logprefix}) -race build the binary with race testing enabled +-tags=TAGS + build the binary with the tags supplied Any other flags will be past to go test. @@ -62,8 +64,8 @@ do iterations="${i#*=}" shift # past argument=value ;; - -race|--race) - race="-race" + -race|--race|-tags=*|--tags=*) + buildflags="${buildflags} $i" shift # past argument with no value ;; *) @@ -74,15 +76,15 @@ do esac done -echo -n "Compiling ${race} ${binary} ... " -go test ${race} -c -o "${binary}" || { +echo -n "Compiling ${buildflags} ${binary} ... " +go test ${buildflags} -c -o "${binary}" || { echo "build failed" exit 1 } echo "OK" for i in $(seq -w ${iterations}); do - echo -n "Test ${race} ${flags} ${i} " + echo -n "Test ${buildflags} ${flags} ${i} " log="${logprefix}${i}.log" ./${binary} ${flags} > ${log} 2>&1 ok=$?