diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-24 23:24:38 -0400 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-24 23:24:38 -0400 |
commit | 27c2154a3da4ad13d646f14c861f58ec923da90e (patch) | |
tree | 4b8aa00069ebb81153f88a19b9580ce8fb4f70c9 /test | |
parent | bc3ac2174e0404b13afee9114bd38e4f3bfb476b (diff) | |
download | luarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.tar.gz luarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.tar.bz2 luarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.zip |
Fixes to luajit testing.
Diffstat (limited to 'test')
-rwxr-xr-x | test/testing.sh | 68 |
1 files changed, 54 insertions, 14 deletions
diff --git a/test/testing.sh b/test/testing.sh index 5ae6bb35..ab56402f 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -30,7 +30,15 @@ then | |||
30 | shift | 30 | shift |
31 | fi | 31 | fi |
32 | 32 | ||
33 | luashortversion=`echo $luaversion | cut -d. -f 1-2` | 33 | is_jit=`[ "${luaversion::3}" = "jit" ] && echo 1` |
34 | |||
35 | if [ "$is_jit" ] | ||
36 | then | ||
37 | luashortversion=5.1 | ||
38 | luajitversion=${luaversion:4} | ||
39 | else | ||
40 | luashortversion=`echo $luaversion | cut -d. -f 1-2` | ||
41 | fi | ||
34 | 42 | ||
35 | testing_dir="$PWD" | 43 | testing_dir="$PWD" |
36 | 44 | ||
@@ -147,13 +155,27 @@ then | |||
147 | if [ ! -e "$luadir/bin/lua" ] | 155 | if [ ! -e "$luadir/bin/lua" ] |
148 | then | 156 | then |
149 | mkdir -p lua | 157 | mkdir -p lua |
150 | echo "Downloading lua $luaversion..." | 158 | cd lua |
151 | wget "http://www.lua.org/ftp/lua-$luaversion.tar.gz" &> /dev/null | 159 | if [ "$is_jit" = 1 ] |
152 | tar zxpf "lua-$luaversion.tar.gz" | 160 | then |
153 | cd "lua-$luaversion" | 161 | echo "Downloading LuaJIT $luajitversion..." |
154 | echo "Building lua $luaversion..." | 162 | #rm -f "LuaJIT-$luajitversion.tar.gz" |
155 | make linux INSTALL_TOP="$luadir" &> /dev/null | 163 | wget -c "http://luajit.org/download/LuaJIT-$luajitversion.tar.gz" &> /dev/null |
156 | make install INSTALL_TOP="$luadir" &> /dev/null | 164 | tar zxpf "LuaJIT-$luajitversion.tar.gz" |
165 | cd "LuaJIT-$luajitversion" | ||
166 | echo "Building LuaJIT $luajitversion..." | ||
167 | make PREFIX="$luadir" &> /dev/null | ||
168 | make install PREFIX="$luadir" &> /dev/null | ||
169 | else | ||
170 | echo "Downloading Lua $luaversion..." | ||
171 | #rm -f "lua-$luaversion.tar.gz" | ||
172 | wget -c "http://www.lua.org/ftp/lua-$luaversion.tar.gz" &> /dev/null | ||
173 | tar zxpf "lua-$luaversion.tar.gz" | ||
174 | cd "lua-$luaversion" | ||
175 | echo "Building Lua $luaversion..." | ||
176 | make linux INSTALL_TOP="$luadir" &> /dev/null | ||
177 | make install INSTALL_TOP="$luadir" &> /dev/null | ||
178 | fi | ||
157 | fi | 179 | fi |
158 | popd | 180 | popd |
159 | [ -e ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa | 181 | [ -e ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa |
@@ -161,7 +183,13 @@ then | |||
161 | chmod og-wx ~/.ssh/authorized_keys | 183 | chmod og-wx ~/.ssh/authorized_keys |
162 | ssh-keyscan localhost >> ~/.ssh/known_hosts | 184 | ssh-keyscan localhost >> ~/.ssh/known_hosts |
163 | else | 185 | else |
164 | luadir="/Programs/Lua/$luaversion" | 186 | if [ "$is_jit" = 1 ] |
187 | then | ||
188 | luadir="/Programs/LuaJIT/$luajitversion" | ||
189 | echo HELLO $luadir | ||
190 | else | ||
191 | luadir="/Programs/Lua/$luaversion" | ||
192 | fi | ||
165 | if [ ! -e "$luadir" ] | 193 | if [ ! -e "$luadir" ] |
166 | then | 194 | then |
167 | luadir="/usr/local" | 195 | luadir="/usr/local" |
@@ -175,7 +203,13 @@ else | |||
175 | platform="linux-x86_64" | 203 | platform="linux-x86_64" |
176 | fi | 204 | fi |
177 | 205 | ||
178 | lua="$luadir/bin/lua" | 206 | if [ "$is_jit" = 1 ] |
207 | then | ||
208 | lua="$luadir/bin/luajit" | ||
209 | luarocks_configure_extra_args="--lua-suffix=jit --with-lua-include=$luadir/include/luajit-2.0" | ||
210 | else | ||
211 | lua="$luadir/bin/lua" | ||
212 | fi | ||
179 | 213 | ||
180 | version_luasocket=3.0rc1 | 214 | version_luasocket=3.0rc1 |
181 | verrev_luasocket=${version_luasocket}-1 | 215 | verrev_luasocket=${version_luasocket}-1 |
@@ -196,7 +230,7 @@ verrev_abelhas=${version_abelhas}-1 | |||
196 | luasec=luasec | 230 | luasec=luasec |
197 | 231 | ||
198 | cd .. | 232 | cd .. |
199 | ./configure --with-lua="$luadir" --prefix="$testing_lrprefix" | 233 | ./configure --with-lua="$luadir" --prefix="$testing_lrprefix" $luarocks_configure_extra_args |
200 | make clean | 234 | make clean |
201 | make src/luarocks/site_config.lua | 235 | make src/luarocks/site_config.lua |
202 | make dev | 236 | make dev |
@@ -525,11 +559,17 @@ test_fetch_base_dir() { $lua <<EOF | |||
525 | EOF | 559 | EOF |
526 | } | 560 | } |
527 | 561 | ||
528 | test_luajit_dependency() { | 562 | test_luajit_dependency() { |
529 | $luajit_luarocks build "$testing_dir/testfiles/luajit-success-1.0-1.rockspec" | 563 | if [ "$is_jit" = 1 ] |
564 | then $luarocks build "$testing_dir/testfiles/luajit-success-1.0-1.rockspec" | ||
565 | else true | ||
566 | fi | ||
530 | } | 567 | } |
531 | fail_luajit_dependency() { | 568 | fail_luajit_dependency() { |
532 | $luajit_luarocks build "$testing_dir/testfiles/luajit-fail-1.0-1.rockspec" | 569 | if [ "$is_jit" = 1 ] |
570 | then $luarocks build "$testing_dir/testfiles/luajit-fail-1.0-1.rockspec" | ||
571 | else false | ||
572 | fi | ||
533 | } | 573 | } |
534 | 574 | ||
535 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } | 575 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } |