build: test-repeat.sh add -tag to buildflags
This commit is contained in:
parent
ce394426b0
commit
62a1a561cf
1 changed files with 8 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# defaults
|
# defaults
|
||||||
race=""
|
buildflags=""
|
||||||
binary="test.binary"
|
binary="test.binary"
|
||||||
flags=""
|
flags=""
|
||||||
iterations="100"
|
iterations="100"
|
||||||
|
@ -29,6 +29,8 @@ Flags this script understands
|
||||||
the log files generated will start with NAME (default ${logprefix})
|
the log files generated will start with NAME (default ${logprefix})
|
||||||
-race
|
-race
|
||||||
build the binary with race testing enabled
|
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.
|
Any other flags will be past to go test.
|
||||||
|
|
||||||
|
@ -62,8 +64,8 @@ do
|
||||||
iterations="${i#*=}"
|
iterations="${i#*=}"
|
||||||
shift # past argument=value
|
shift # past argument=value
|
||||||
;;
|
;;
|
||||||
-race|--race)
|
-race|--race|-tags=*|--tags=*)
|
||||||
race="-race"
|
buildflags="${buildflags} $i"
|
||||||
shift # past argument with no value
|
shift # past argument with no value
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -74,15 +76,15 @@ do
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
echo -n "Compiling ${race} ${binary} ... "
|
echo -n "Compiling ${buildflags} ${binary} ... "
|
||||||
go test ${race} -c -o "${binary}" || {
|
go test ${buildflags} -c -o "${binary}" || {
|
||||||
echo "build failed"
|
echo "build failed"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
echo "OK"
|
echo "OK"
|
||||||
|
|
||||||
for i in $(seq -w ${iterations}); do
|
for i in $(seq -w ${iterations}); do
|
||||||
echo -n "Test ${race} ${flags} ${i} "
|
echo -n "Test ${buildflags} ${flags} ${i} "
|
||||||
log="${logprefix}${i}.log"
|
log="${logprefix}${i}.log"
|
||||||
./${binary} ${flags} > ${log} 2>&1
|
./${binary} ${flags} > ${log} 2>&1
|
||||||
ok=$?
|
ok=$?
|
||||||
|
|
Loading…
Reference in a new issue