aboutsummaryrefslogtreecommitdiffstats
path: root/git_hooks/pre-commit
blob: f8dacac2a84c8e10f44a369735423728e35b6cd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh

echo "Preparing to run tests..."

TDIR=`mktemp -d -t vimium`

if [ $? -ne 0 ]
then
  exit 1
fi

git checkout-index --prefix=$TDIR/ -af
# because submodules don't get picked up by checkout-index
cp -r ./tests/shoulda.js/ $TDIR/tests/shoulda.js/

pushd $TDIR > /dev/null
  cake build
  cake test
  TEST_RESULT=$?
popd

echo "Tests completed."

rm -rf $TDIR

exit $TEST_RESULT