diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-06-29 21:31:11 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-06-29 21:31:11 -0300 |
commit | 5861782615800511551adafce78844c93734abb9 (patch) | |
tree | 02ec1d712945b38515c373aa8a9dda21dbccd6c7 /test | |
parent | 1eccb0385c6bef170ceee86a6415d7442c28699d (diff) | |
parent | 7e464b149c3ec47161249bd316e446f5261516ab (diff) | |
download | luarocks-5861782615800511551adafce78844c93734abb9.tar.gz luarocks-5861782615800511551adafce78844c93734abb9.tar.bz2 luarocks-5861782615800511551adafce78844c93734abb9.zip |
Merge pull request #400 from ignacio/400-config-help
'config' command does not have a help message
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 48d4ac0e..50911fd4 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_format = function() return run '$luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2' end, | 407 | test_write_rockspec_format = function() return run '$luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2' end, |
@@ -406,6 +410,33 @@ local tests = { | |||
406 | fail_write_rockspec_args_url = function() return run "$luarocks write_rockspec http://example.com/invalid.zip" end, | 410 | fail_write_rockspec_args_url = function() return run "$luarocks write_rockspec http://example.com/invalid.zip" end, |
407 | 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, | 411 | 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, |
408 | 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 | 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, |
413 | |||
414 | fail_config_noflags = function() return run "$luarocks config; " end, | ||
415 | test_config_lua_incdir = function() return run "$luarocks config --lua-incdir; " end, | ||
416 | test_config_lua_libdir = function() return run "$luarocks config --lua-libdir; " end, | ||
417 | test_config_lua_ver = function() return run "$luarocks config --lua-ver; " end, | ||
418 | fail_config_system_config = function() | ||
419 | return rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
420 | and run "$luarocks config --system-config; " | ||
421 | end, | ||
422 | test_config_system_config = function() | ||
423 | local ok = mkdir "$testing_lrprefix/etc/luarocks" | ||
424 | and touch "$testing_lrprefix/etc/luarocks/config.lua" | ||
425 | and run "$luarocks config --system-config; " | ||
426 | rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
427 | return ok | ||
428 | end, | ||
429 | fail_config_system_config_invalid = function() | ||
430 | local ok = mkdir "$testing_lrprefix/etc/luarocks" | ||
431 | and run "echo 'if if if' > '$testing_lrprefix/etc/luarocks/config.lua' ;" | ||
432 | and run "$luarocks config --system-config" | ||
433 | rm "$testing_lrprefix/etc/luarocks/config.lua" | ||
434 | return ok | ||
435 | end, | ||
436 | test_config_user_config = function() return run "$luarocks config --user-config; " end, | ||
437 | fail_config_user_config = function() return run "LUAROCKS_CONFIG='/missing_file.lua' $luarocks config --user-config; " end, | ||
438 | test_config_rock_trees = function() return run "$luarocks config --rock-trees;" end, | ||
439 | test_config_help = function() return run "$luarocks help config;" end, | ||
409 | test_doc = function() | 440 | test_doc = function() |
410 | return run "$luarocks install luarepl" | 441 | return run "$luarocks install luarepl" |
411 | and run "$luarocks doc luarepl" | 442 | and run "$luarocks doc luarepl" |
diff --git a/test/testing.sh b/test/testing.sh index c43b4d52..133597ee 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -509,6 +509,7 @@ fail_config_system_config_invalid() { mkdir -p "$testing_lrprefix/etc/luarocks"; | |||
509 | test_config_user_config() { $luarocks config --user-config; } | 509 | test_config_user_config() { $luarocks config --user-config; } |
510 | fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config --user-config; } | 510 | fail_config_user_config() { LUAROCKS_CONFIG="/missing_file.lua" $luarocks config --user-config; } |
511 | test_config_rock_trees() { $luarocks config --rock-trees; } | 511 | test_config_rock_trees() { $luarocks config --rock-trees; } |
512 | test_config_help() { $luarocks help config; } | ||
512 | 513 | ||
513 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } | 514 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } |
514 | 515 | ||