forked from rrnewton/concurrent-skiplist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.jenkins_script.sh
executable file
·71 lines (57 loc) · 1.82 KB
/
.jenkins_script.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
70
71
#!/bin/bash
PKGS=" ./concurrent-skiplist"
# ========================================
# Generic GHC package testing setup:
# ========================================
# NOTE: uses env vars JENKINS_GHC and CABAL_FLAGS, if available.
# Also passes through extra args to the major cabal install command.
set -e
set -x
# Temporarily staying off of 1.20 due to cabal issue #1811:
CABAL=cabal-1.18.0
SHOWDETAILS=always
# SHOWDETAILS=streaming
if [ "$JENKINS_GHC" == "" ]; then
GHC=ghc
else
ENVSCRIPT=$HOME/rn_jenkins_scripts/acquire_ghc.sh
# This is specific to our testing setup at IU:
if [ -f "$ENVSCRIPT" ]; then
source "$ENVSCRIPT"
fi
GHC=ghc-$JENKINS_GHC
fi
TOP=`pwd`
$CABAL sandbox init
$CABAL sandbox hc-pkg list
for path in $PKGS; do
cd $TOP/$path
$CABAL sandbox init --sandbox=$TOP/.cabal-sandbox
done
cd $TOP
CFG=" --force-reinstalls "
if [ "$PROF" == "" ] || [ "$PROF" == "0" ]; then
CFG="$CFG --disable-library-profiling --disable-executable-profiling"
else
CFG="$CFG --enable-library-profiling --enable-executable-profiling"
fi
# Install dependencies in parallel, including those needed for testing:
$CABAL install $CFG $CABAL_FLAGS --with-ghc=$GHC $PKGS --enable-tests --only-dep $*
# Install the packages WITHOUT testing:
$CABAL install $CFG $CABAL_FLAGS --with-ghc=$GHC $PKGS $*
GHC_VER=`$GHC --version | egrep -o '[0123456789]+\.[0123456789]+\.[0123456789]+'`
MAJOR=`echo $GHC_VER | sed 's/\.[[:digit:]]*$//'`
OLDVER=`echo "$MAJOR < 7.8" | bc`
# Avoiding the atomic-primops related bug on linux / GHC 7.6:
# Temporarily just DONT test under linux, fixme!!
if [ `uname` == "Linux" ] && [ "$OLDVER" == 1 ] ;
then
echo "Skipping tests!"
else
for path in $PKGS; do
echo "Test package in path $path."
cd $TOP/$path
# Assume cabal 1.20+:
cabal test --show-details=$SHOWDETAILS
done
fi