diff options
author | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-06-26 12:28:13 -0300 |
---|---|---|
committer | Ignacio Burgueño <ignaciob@inconcertcc.com> | 2015-06-26 12:28:13 -0300 |
commit | ed97ece0c1992d93b9a4a18a9abc413ece19a4ea (patch) | |
tree | 617e8ebf15dc9c5f4e1f8d97b8edf9c8ead7bc0d /test | |
parent | f10113ff32a1ab9fff5abe68e84ccc5bad9a4908 (diff) | |
download | luarocks-ed97ece0c1992d93b9a4a18a9abc413ece19a4ea.tar.gz luarocks-ed97ece0c1992d93b9a4a18a9abc413ece19a4ea.tar.bz2 luarocks-ed97ece0c1992d93b9a4a18a9abc413ece19a4ea.zip |
Adds missing tests
Diffstat (limited to 'test')
-rw-r--r-- | test/testing.lua | 33 | ||||
-rwxr-xr-x | test/testing.sh | 1 |
2 files changed, 33 insertions, 1 deletions
diff --git a/test/testing.lua b/test/testing.lua index 44c6f098..4a5d73eb 100644 --- a/test/testing.lua +++ b/test/testing.lua | |||
@@ -50,6 +50,10 @@ local function glob(patt) | |||
50 | -- TODO | 50 | -- TODO |
51 | end | 51 | end |
52 | 52 | ||
53 | local function touch(filename) | ||
54 | -- TODO | ||
55 | end | ||
56 | |||
53 | local function rm(...) | 57 | local function rm(...) |
54 | for _, filename in ipairs {...} do | 58 | for _, filename in ipairs {...} do |
55 | filename = expand_variables(filename) | 59 | filename = expand_variables(filename) |
@@ -397,7 +401,7 @@ local tests = { | |||
397 | local found = run_get_contents '$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg' | 401 | local found = run_get_contents '$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg' |
398 | rm_rf "./lxsh-${verrev_lxsh}" | 402 | rm_rf "./lxsh-${verrev_lxsh}" |
399 | return found ~= "" | 403 | return found ~= "" |
400 | end, | 404 | end, |
401 | test_write_rockspec = function() return run "$luarocks write_rockspec git://github.com/keplerproject/luarocks" end, | 405 | test_write_rockspec = function() return run "$luarocks write_rockspec git://github.com/keplerproject/luarocks" end, |
402 | test_write_rockspec_lib = function() return run '$luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2' end, | 406 | test_write_rockspec_lib = function() return run '$luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2' end, |
403 | test_write_rockspec_fullargs = function() return run '$luarocks write_rockspec git://github.com/keplerproject/luarocks --lua-version=5.1,5.2 --license="MIT/X11" --homepage="http://www.luarocks.org" --summary="A package manager for Lua modules"' end, | 407 | test_write_rockspec_fullargs = function() return run '$luarocks write_rockspec git://github.com/keplerproject/luarocks --lua-version=5.1,5.2 --license="MIT/X11" --homepage="http://www.luarocks.org" --summary="A package manager for Lua modules"' end, |
@@ -405,6 +409,33 @@ local tests = { | |||
405 | fail_write_rockspec_args_url = function() return run "$luarocks write_rockspec http://example.com/invalid.zip" end, | 409 | fail_write_rockspec_args_url = function() return run "$luarocks write_rockspec http://example.com/invalid.zip" end, |
406 | test_write_rockspec_http = function() return run "$luarocks write_rockspec http://luarocks.org/releases/luarocks-2.1.0.tar.gz --lua-version=5.1" end, | 410 | test_write_rockspec_http = function() return run "$luarocks write_rockspec http://luarocks.org/releases/luarocks-2.1.0.tar.gz --lua-version=5.1" end, |
407 | test_write_rockspec_basedir = function() return run "$luarocks write_rockspec https://github.com/downloads/Olivine-Labs/luassert/luassert-1.2.tar.gz --lua-version=5.1" end, | 411 | test_write_rockspec_basedir = function() return run "$luarocks write_rockspec https://github.com/downloads/Olivine-Labs/luassert/luassert-1.2.tar.gz --lua-version=5.1" end, |
412 | |||
413 | fail_config_noflags = function() return run "$luarocks config; " end, | ||
414 | test_config_lua_incdir = function() return run "$luarocks config --lua-incdir; " end, | ||
415 | test_config_lua_libdir = function() return run "$luarocks config --lua-libdir; " end, | ||
416 | test_config_lua_ver = function() return run "$luarocks config --lua-ver; " end, | ||
417 | fail_config_system_config = function() | ||
418 | return rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
419 | and run "$luarocks config --system-config; " | ||
420 | end, | ||
421 | test_config_system_config = function() | ||
422 | local ok = mkdir "$testing_lrprefix/etc/luarocks" | ||
423 | and touch "$testing_lrprefix/etc/luarocks/config.lua" | ||
424 | and run "$luarocks config --system-config; " | ||
425 | rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
426 | return ok | ||
427 | end, | ||
428 | fail_config_system_config_invalid = function() | ||
429 | local ok = mkdir "$testing_lrprefix/etc/luarocks" | ||
430 | and run "echo 'if if if' > '$testing_lrprefix/etc/luarocks/config.lua' ;" | ||
431 | and run "$luarocks config --system-config" | ||
432 | rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
433 | return ok | ||
434 | end, | ||
435 | test_config_user_config = function() return run "$luarocks config --user-config; " end, | ||
436 | fail_config_user_config = function() return run "LUAROCKS_CONFIG='/missing_file.lua' $luarocks config --user-config; " end, | ||
437 | test_config_rock_trees = function() return run "$luarocks config --rock-trees;" end, | ||
438 | test_config_help = function() return run "$luarocks help config;" end, | ||
408 | test_doc = function() | 439 | test_doc = function() |
409 | return run "$luarocks install luarepl" | 440 | return run "$luarocks install luarepl" |
410 | and run "$luarocks doc luarepl" | 441 | and run "$luarocks doc luarepl" |
diff --git a/test/testing.sh b/test/testing.sh index 4338e48f..4f88538b 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -508,6 +508,7 @@ fail_config_system_config_invalid() { mkdir -p "$testing_lrprefix/etc/luarocks"; | |||
508 | test_config_user_config() { $luarocks config --user-config; } | 508 | test_config_user_config() { $luarocks config --user-config; } |
509 | fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config --user-config; } | 509 | fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config --user-config; } |
510 | test_config_rock_trees() { $luarocks config --rock-trees; } | 510 | test_config_rock_trees() { $luarocks config --rock-trees; } |
511 | test_config_help() { $luarocks help config; } | ||
511 | 512 | ||
512 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } | 513 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } |
513 | 514 | ||