-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathci.sh
executable file
·129 lines (112 loc) · 3.3 KB
/
ci.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/env bash
set -e
SRCDIR=${SRCDIR:-$PWD}
# The following assumes that REPO_URL looks like this: https://provider.com/username/packagename.git
PKG_NAME="$(basename ${REPO_URL} .git)"
echo SRCDIR : $SRCDIR
echo REPO_URL : $REPO_URL
echo PKG_NAME : $PKG_NAME
git clone ${REPO_URL}
cd ${PKG_NAME}
git log -n 1
###############################################################################
#
# for Semigroups package
if [[ -f prerequisites.sh ]]
then
./prerequisites.sh
fi
# for NormalizInterface
if [[ -f build-normaliz.sh ]]
then
./build-normaliz.sh ${GAP_HOME}
fi
# The next block is borrowed from
# https://github.com/gap-system/gap/blob/master/bin/BuildPackages.sh
#
# build this package, if necessary
#
# We want to know if this is an autoconf configure script
# or not, without actually executing it!
if [[ -f autogen.sh && ! -f configure ]]
then
./autogen.sh
fi
if [[ -f "configure" ]]
then
if grep Autoconf ./configure > /dev/null
then
./configure --with-gaproot=${GAP_HOME}
else
./configure ${GAP_HOME}
fi
make
else
echo "No building required for $PKG"
fi
# set up a custom GAP root containing only this package, so that
# we can force GAP to load the correct version of this package
mkdir -p gaproot/pkg/
ln -s $PWD gaproot/pkg/
###############################################################################
# start GAP with custom GAP root, to ensure correct package version is loaded
GAP="${GAP_HOME}/bin/gap.sh -l $PWD/gaproot; --quitonbreak -q"
echo ""
echo "######################################################################"
echo "#"
echo "# TESTING WHETHER THE PACKAGE IS LOADABLE"
echo "#"
echo "######################################################################"
echo ""
$GAP <<GAPInput
Read("/home/gap/travis/ci.g");
SetInfoLevel(InfoPackageLoading,4);
if LoadPackage(LowercaseString(GetNameFromPackageInfo("PackageInfo.g"))) <> true then
Print("PACKAGE IS NOT LOADABLE - TEST TERMINATED\n");
FORCE_QUIT_GAP(1);
fi;
QUIT_GAP(0);
GAPInput
echo ""
echo "######################################################################"
echo "#"
echo "# TEST WITH DEFAULT PACKAGES, LOADED AT GAP STARTUP"
echo "#"
echo "######################################################################"
echo ""
$GAP <<GAPInput
Read("/home/gap/travis/ci.g");
if TestOnePackage(LowercaseString(GetNameFromPackageInfo("PackageInfo.g"))) <> true then
FORCE_QUIT_GAP(1);
fi;
QUIT_GAP(0);
GAPInput
echo ""
echo "######################################################################"
echo "#"
echo "# TEST WITHOUT PACKAGES, EXCEPT REQUIRED BY GAP (using -A option)"
echo "#"
echo "######################################################################"
echo ""
$GAP -A <<GAPInput
Read("/home/gap/travis/ci.g");
if TestOnePackage(LowercaseString(GetNameFromPackageInfo("PackageInfo.g"))) <> true then
FORCE_QUIT_GAP(1);
fi;
QUIT_GAP(0);
GAPInput
echo ""
echo "######################################################################"
echo "#"
echo "# TEST WITH ALL PACKAGES LOADED (using LoadAllPackages() command)"
echo "#"
echo "######################################################################"
echo ""
$GAP <<GAPInput
LoadAllPackages();
Read("/home/gap/travis/ci.g");
if TestOnePackage(LowercaseString(GetNameFromPackageInfo("PackageInfo.g"))) <> true then
FORCE_QUIT_GAP(1);
fi;
QUIT_GAP(0);
GAPInput