aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2015-10-24 23:24:38 -0400
committerHisham Muhammad <hisham@gobolinux.org>2015-10-24 23:24:38 -0400
commit27c2154a3da4ad13d646f14c861f58ec923da90e (patch)
tree4b8aa00069ebb81153f88a19b9580ce8fb4f70c9 /test
parentbc3ac2174e0404b13afee9114bd38e4f3bfb476b (diff)
downloadluarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.tar.gz
luarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.tar.bz2
luarocks-27c2154a3da4ad13d646f14c861f58ec923da90e.zip
Fixes to luajit testing.
Diffstat (limited to 'test')
-rwxr-xr-xtest/testing.sh68
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
31fi 31fi
32 32
33luashortversion=`echo $luaversion | cut -d. -f 1-2` 33is_jit=`[ "${luaversion::3}" = "jit" ] && echo 1`
34
35if [ "$is_jit" ]
36then
37 luashortversion=5.1
38 luajitversion=${luaversion:4}
39else
40 luashortversion=`echo $luaversion | cut -d. -f 1-2`
41fi
34 42
35testing_dir="$PWD" 43testing_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
163else 185else
164 luadir="/Programs/Lua/$luaversion" 186 if [ "$is_jit" = 1 ]
187 then
188 luadir="/Programs/LuaJIT/$luajitversion"
189echo 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"
176fi 204fi
177 205
178lua="$luadir/bin/lua" 206if [ "$is_jit" = 1 ]
207then
208 lua="$luadir/bin/luajit"
209 luarocks_configure_extra_args="--lua-suffix=jit --with-lua-include=$luadir/include/luajit-2.0"
210else
211 lua="$luadir/bin/lua"
212fi
179 213
180version_luasocket=3.0rc1 214version_luasocket=3.0rc1
181verrev_luasocket=${version_luasocket}-1 215verrev_luasocket=${version_luasocket}-1
@@ -196,7 +230,7 @@ verrev_abelhas=${version_abelhas}-1
196luasec=luasec 230luasec=luasec
197 231
198cd .. 232cd ..
199./configure --with-lua="$luadir" --prefix="$testing_lrprefix" 233./configure --with-lua="$luadir" --prefix="$testing_lrprefix" $luarocks_configure_extra_args
200make clean 234make clean
201make src/luarocks/site_config.lua 235make src/luarocks/site_config.lua
202make dev 236make dev
@@ -525,11 +559,17 @@ test_fetch_base_dir() { $lua <<EOF
525EOF 559EOF
526} 560}
527 561
528test_luajit_dependency() { 562test_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}
531fail_luajit_dependency() { 568fail_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
535test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } 575test_doc() { $luarocks install luarepl; $luarocks doc luarepl; }