File: git-annex-remote-datalad

package info (click to toggle)
datalad 1.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,148 kB
  • sloc: python: 69,414; sh: 1,521; makefile: 220
file content (30 lines) | stat: -rwxr-xr-x 858 bytes parent folder | download | duplicates (12)
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
#!/bin/bash
#
# A little helper to overload default datalad executables with the one ran
# through coverage

set -eu

bin=$(basename $0)
curbin=$(which "$bin")
curdatalad=$(which datalad)
curdir=$(dirname $curdatalad)

COVERAGE_RUN="-m coverage run"
export COVERAGE_PROCESS_START=$PWD/../.coveragerc
export PYTHONPATH="$PWD/../tools/coverage-bin/"
export PATH=${PATH//$curdir:/}
newdatalad=$(which datalad)
newbin=$(which $bin)
newpython=$(sed -ne '1s/#!//gp' $newdatalad)

if [ $newdatalad = $curdatalad ]; then
   echo "E: binary remained the same: $newdatalad" >&2
   exit 1
fi

touch /tmp/coverages
export COVERAGE_FILE=/tmp/.coverage-entrypoints-$RANDOM
echo "Running now $newpython $COVERAGE_RUN --include=datalad/* -a $newbin $@" >> /tmp/coverages
#$newpython $COVERAGE_RUN --include=datalad/* -a $newbin "$@"
$newpython $COVERAGE_RUN -a $newbin "$@"