-
Notifications
You must be signed in to change notification settings - Fork 14
/
prerelease.sh
executable file
·69 lines (57 loc) · 2.1 KB
/
prerelease.sh
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
set -eu # exit on first error or undefined value in subtitution
set -o pipefail
# get current directory
INIT_DIR=`pwd`
rm -rf blib
# get location of this file
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
if [ -z "$MY_PATH" ] ; then
# error; for some reason, the path is not accessible
# to the script (e.g. permissions re-evaled after suid)
echo Failed to determine location of script >2
exit 1 # fail
fi
# change into the location of the script
cd $MY_PATH
echo -e '\n### Compile/Test C ###\n'
set +u
if [ "x$HTSLIB" == "x" ] || [ "x$LIBBIGWIG" == "x" ]; then
echo -e '\n\t$HTSLIB or $LIBBIGWIG not defined skipping C compile/test\n'
else
make -C c clean
make -C c
make -C c clean
fi
set -u
echo -e '\n\n### Running perl tests ###\n'
export HARNESS_PERL_SWITCHES=-MDevel::Cover=-db,reports,-select='^lib/*\.pm$',-ignore,'^t/'
rm -rf reports docs pm_to_blib blib
cover -delete
mkdir -p docs/reports_text
prove -w -j 9 -I ./lib
echo -e '\n\n### Generating test/pod coverage reports ###\n'
# removed 'condition' from coverage as '||' 'or' doesn't work properly
cover -coverage branch,subroutine,pod -report_c0 50 -report_c1 85 -report_c2 100 -report html_basic reports -silent
cover -coverage branch,subroutine,pod -report text reports -silent > docs/reports_text/coverage.txt
rm -rf reports/structure reports/digests reports/cover.13 reports/runs
cp reports/coverage.html reports/index.html
mv reports docs/reports_html
unset HARNESS_PERL_SWITCHES
echo '### Generating POD ###'
mkdir -p docs/pod_html
perl -MPod::Simple::HTMLBatch -e 'Pod::Simple::HTMLBatch::go' lib:bin docs/pod_html > /dev/null
echo '### Archiving docs folder ###'
tar cz -C $INIT_DIR -f docs.tar.gz docs
# generate manifest, and cleanup
echo '### Generating MANIFEST ###'
# delete incase any files are moved, the make target just adds stuff
rm -f MANIFEST
# cleanup things which could break the manifest
rm -rf install_tmp
perl Makefile.PL > /dev/null
make manifest &> /dev/null
rm -f Makefile MANIFEST.bak pm_to_blib
# change back to original dir
cd $INIT_DIR