diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-19 18:46:21 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-10-19 18:46:45 -0200 |
commit | f8179800d0eccaef960442a7e65b1e305f3a96d5 (patch) | |
tree | a16878df7e9f602ae58baae7ba08c003e0672798 /test | |
parent | 24049bffb8069ceff1a4e0f4367389c531188fef (diff) | |
download | luarocks-f8179800d0eccaef960442a7e65b1e305f3a96d5.tar.gz luarocks-f8179800d0eccaef960442a7e65b1e305f3a96d5.tar.bz2 luarocks-f8179800d0eccaef960442a7e65b1e305f3a96d5.zip |
Support "luajit" as a provided dependency in rockspec format 3.0
Diffstat (limited to 'test')
-rw-r--r-- | test/testfiles/luajit-fail-1.0-1.rockspec | 22 | ||||
-rw-r--r-- | test/testfiles/luajit-success-1.0-1.rockspec | 23 | ||||
-rwxr-xr-x | test/testing.sh | 8 |
3 files changed, 53 insertions, 0 deletions
diff --git a/test/testfiles/luajit-fail-1.0-1.rockspec b/test/testfiles/luajit-fail-1.0-1.rockspec new file mode 100644 index 00000000..f8204600 --- /dev/null +++ b/test/testfiles/luajit-fail-1.0-1.rockspec | |||
@@ -0,0 +1,22 @@ | |||
1 | package = "luajit-fail" | ||
2 | version = "1.0-1" | ||
3 | source = { | ||
4 | url = "https://raw.githubusercontent.com/keplerproject/luarocks/master/test/testing.lua", | ||
5 | } | ||
6 | description = { | ||
7 | summary = "Test luajit dependency fail", | ||
8 | detailed = [[ | ||
9 | Fail luajit dependency when running with rockspec_format < 3.0. | ||
10 | ]], | ||
11 | homepage = "http://luarocks.org/", | ||
12 | license = "MIT/X license" | ||
13 | } | ||
14 | dependencies = { | ||
15 | "luajit >= 2.0" | ||
16 | } | ||
17 | build = { | ||
18 | type = "builtin", | ||
19 | modules = { | ||
20 | testing = "testing.lua" | ||
21 | } | ||
22 | } | ||
diff --git a/test/testfiles/luajit-success-1.0-1.rockspec b/test/testfiles/luajit-success-1.0-1.rockspec new file mode 100644 index 00000000..31c930c3 --- /dev/null +++ b/test/testfiles/luajit-success-1.0-1.rockspec | |||
@@ -0,0 +1,23 @@ | |||
1 | rockspec_format = "3.0" | ||
2 | package = "luajit-success" | ||
3 | version = "1.0-1" | ||
4 | source = { | ||
5 | url = "https://raw.githubusercontent.com/keplerproject/luarocks/master/test/testing.lua", | ||
6 | } | ||
7 | description = { | ||
8 | summary = "Test luajit dependency fail", | ||
9 | detailed = [[ | ||
10 | Use luajit dependency when running with rockspec_format >= 3.0. | ||
11 | ]], | ||
12 | homepage = "http://luarocks.org/", | ||
13 | license = "MIT/X license" | ||
14 | } | ||
15 | dependencies = { | ||
16 | "luajit >= 2.0" | ||
17 | } | ||
18 | build = { | ||
19 | type = "builtin", | ||
20 | modules = { | ||
21 | testing = "testing.lua" | ||
22 | } | ||
23 | } | ||
diff --git a/test/testing.sh b/test/testing.sh index 7292c75d..5ae6bb35 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -224,6 +224,7 @@ luarocks_noecho="run_lua --noecho luarocks" | |||
224 | luarocks_noecho_nocov="run_lua --noecho --nocov luarocks" | 224 | luarocks_noecho_nocov="run_lua --noecho --nocov luarocks" |
225 | luarocks_admin="run_lua luarocks-admin" | 225 | luarocks_admin="run_lua luarocks-admin" |
226 | luarocks_admin_nocov="run_lua --nocov luarocks-admin" | 226 | luarocks_admin_nocov="run_lua --nocov luarocks-admin" |
227 | luajit_luarocks="luajit -e require('luacov.runner')('$testing_dir/luacov.config') $basedir/bin/luarocks" | ||
227 | 228 | ||
228 | ################################################### | 229 | ################################################### |
229 | 230 | ||
@@ -524,6 +525,13 @@ test_fetch_base_dir() { $lua <<EOF | |||
524 | EOF | 525 | EOF |
525 | } | 526 | } |
526 | 527 | ||
528 | test_luajit_dependency() { | ||
529 | $luajit_luarocks build "$testing_dir/testfiles/luajit-success-1.0-1.rockspec" | ||
530 | } | ||
531 | fail_luajit_dependency() { | ||
532 | $luajit_luarocks build "$testing_dir/testfiles/luajit-fail-1.0-1.rockspec" | ||
533 | } | ||
534 | |||
527 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } | 535 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } |
528 | 536 | ||
529 | # Driver ######################################### | 537 | # Driver ######################################### |