aboutsummaryrefslogtreecommitdiffstats
path: root/git_hooks/pre-commit
blob: 495e618e5750fcb98d8ac5532d792688bfc399fa (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 > /dev/null

echo "Tests completed."

rm -rf $TDIR

exit $TEST_RESULT