summaryrefslogtreecommitdiff
path: root/taler-build/update_merchant.sh
blob: 9c32d6d5526937877fd05603c6840f817c2ec462 (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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

# Run as:
# $ ./update_merchant.sh [--coverage]
set -eu

cd $HOME/merchant/
git clean -fdx

# like "git pull", but robust against force pushes
# and local changes
git fetch
git reset --hard FETCH_HEAD

git submodule update --init --force

./bootstrap
if test "$1" = "--coverage"; then
  ./configure CFLAGS='-ggdb -O0' \
    --prefix=$HOME/local --with-gnunet=$HOME/local \
    --with-mint=$HOME/local \
    --with-microhttpd=$HOME/local \
    --enable-logging=verbose \
    --enable-coverage
  else
  ./configure CFLAGS='-ggdb -O0' \
    --prefix=$HOME/local --with-gnunet=$HOME/local \
    --with-mint=$HOME/local \
    --with-microhttpd=$HOME/local \
    --enable-logging=verbose
fi
    
make
make install
TALER_MERCHANTDB_POSTGRES_CONFIG=$TALER_CHECKDB TALER_EXCHANGEDB_POSTGRES_CONFIG=$TALER_CHECKDB make check

if test "$1" = "--coverage"; then
TALER_MERCHANTDB_POSTGRES_CONFIG=$TALER_CHECKDB TALER_EXCHANGEDB_POSTGRES_CONFIG=$TALER_CHECKDB make check || exit 1
TOP=$(pwd)
  mkdir -p doc/coverage/
  lcov -d $TOP -z
  lcov -d $TOP -c --no-external -o doc/coverage/coverage.info
  lcov -r doc/coverage/coverage.info **/test_* -o doc/coverage/rcoverage.info
  genhtml -o doc/coverage doc/coverage/rcoverage.info
fi