aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test/run_tests.sh')
-rwxr-xr-xtest/run_tests.sh75
1 files changed, 0 insertions, 75 deletions
diff --git a/test/run_tests.sh b/test/run_tests.sh
deleted file mode 100755
index 672b877e..00000000
--- a/test/run_tests.sh
+++ /dev/null
@@ -1,75 +0,0 @@
1#!/bin/bash
2
3if [ -e ./run_tests.sh ]
4then
5 cd ../src
6elif [ -d src ]
7then
8 cd src
9elif ! [ -d luarocks ]
10then
11 echo "Go to the src directory and run this."
12 exit 1
13fi
14
15if [ ! -d ../rocks ]
16then
17 echo "Downloading entire rocks repository for tests"
18 cd ..
19 cp -a ~/.cache/luarocks/rocks .
20 cd src
21fi
22
23rocks=(
24 `ls ../rocks/*.src.rock | grep -v luacom`
25)
26
27bin/luarocks-admin make-manifest ../rocks || exit 1
28
29[ "$1" ] && rocks=("$1")
30
31TRY() {
32 "$@" || {
33 echo "Failed running: $@"
34 exit 1
35 }
36}
37
38list_search() {
39 bin/luarocks list $name | grep $version
40}
41
42for rock in "${rocks[@]}"
43do
44 base=`basename $rock`
45 baserockspec=`basename $rock .rockspec`
46 basesrcrock=`basename $rock .src.rock`
47 if [ "$base" != "$baserockspec" ]
48 then
49 base=$baserockspec
50 name=`echo $base | sed 's/\(.*\)-[^-]*-[^-]*$/\1/'`
51 version=`echo $base | sed 's/.*-\([^-]*-[^-]*\)$/\1/'`
52 TRY bin/luarocks pack $rock
53 TRY bin/luarocks build $base.src.rock
54 TRY rm $base.src.rock
55 else
56 base=$basesrcrock
57 name=`echo $base | sed 's/\(.*\)-[^-]*-[^-]*$/\1/'`
58 version=`echo $base | sed 's/.*-\([^-]*-[^-]*\)$/\1/'`
59 TRY bin/luarocks build $rock
60 fi
61 TRY bin/luarocks pack $name $version
62 TRY bin/luarocks install $base.*.rock
63 TRY rm $base.*.rock
64 TRY list_search $name $version
65 bin/luarocks remove $name $version
66 # TODO: differentiate between error and dependency block.
67done
68
69if bin/luarocks install nonexistant | grep "No results"
70then echo "OK, got expected error."
71else exit 1
72fi
73
74TRY ../test/test_deps.lua
75TRY ../test/test_require.lua