tests.bash: OSX compat: use "flock -n" and skip openssl build

Mac OS X flock does not support "--nonblock", but does support "-n":
https://github.com/discoteq/flock/blob/master/man/flock.1.ronn

Skip the openssl build because it requires
1) openssl
2) fixing the import paths in gocryptfs

Reported at https://github.com/rfjakob/gocryptfs/issues/15#issuecomment-280464400
This commit is contained in:
Jakob Unterwurzacher 2017-02-17 19:41:29 +01:00
parent 07b4b9d60b
commit 7fbe69bfa6
1 changed files with 5 additions and 2 deletions

View File

@ -12,7 +12,7 @@ mkdir -p $TESTDIR
(
# Prevent multiple parallel test.bash instances as this causes
# all kinds of mayham
if ! flock --nonblock 200 ; then
if ! flock -n 200 ; then
echo "Could not acquire lock on $LOCKFILE - already running?"
exit 1
fi
@ -25,7 +25,10 @@ for i in $(mount | grep $TESTDIR | cut -f3 -d" "); do
done
source build-without-openssl.bash
source build.bash
# Building with openssl is difficult on OSX, so only do it on Linux.
if [[ $OSTYPE == linux* ]] ; then
source build.bash
fi
if go tool | grep vet > /dev/null ; then
go tool vet -all -shadow .