#!/bin/sh
SOURCE_DIR=$1
BUILD_DIR="${SOURCE_DIR}/.build-tests.ignore"

mkdir $BUILD_DIR && cd $BUILD_DIR
cmake $SOURCE_DIR -DCMAKE_BUILD_TYPE=Release
make all > /dev/null
make test
RESULT=$?

[ $RESULT -ne 0 ] && exit 1 
exit 0

#!/bin/sh
SOURCE_DIR=$1
BUILD_DIR="${SOURCE_DIR}/.build-tests.ignore"

mkdir -p $BUILD_DIR && cd $BUILD_DIR
cmake $SOURCE_DIR -DCMAKE_BUILD_TYPE=Release
make all > /dev/null
make test
RESULT=$?

[ $RESULT -ne 0 ] && exit 1 
exit 0

Fix commit test script in-source build
Fix commit test script in-source build

If the test build directory existed already, the pre-commit script
would trigger an in-source build, polluting the repository with
CMake cache files
