diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2015-04-08 17:25:02 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-04-08 17:25:02 -0300 |
commit | 1fcf354f4736ed2349d18a5f08262810dbc8dc9c (patch) | |
tree | 1b5a3dad2d87314f2e732048c02e486b6803dd5d /test | |
parent | 3ce554cd17896b15e0df149c1ef43be404b868e0 (diff) | |
download | luarocks-1fcf354f4736ed2349d18a5f08262810dbc8dc9c.tar.gz luarocks-1fcf354f4736ed2349d18a5f08262810dbc8dc9c.tar.bz2 luarocks-1fcf354f4736ed2349d18a5f08262810dbc8dc9c.zip |
Add test that checks for error in default sysconfig.
See #346.
Diffstat (limited to 'test')
-rw-r--r-- | test/testing.lua | 8 | ||||
-rwxr-xr-x | test/testing.sh | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/test/testing.lua b/test/testing.lua index 9103c19a..b34e9ab2 100644 --- a/test/testing.lua +++ b/test/testing.lua | |||
@@ -82,12 +82,18 @@ local tests = { | |||
82 | fail_arg_string_followed_by_flag = function() return run "$luarocks --server --porcelain" end, | 82 | fail_arg_string_followed_by_flag = function() return run "$luarocks --server --porcelain" end, |
83 | fail_arg_string_unknown = function() return run "$luarocks --invalid-flag=abc" end, | 83 | fail_arg_string_unknown = function() return run "$luarocks --invalid-flag=abc" end, |
84 | test_empty_list = function() return run "$luarocks list" end, | 84 | test_empty_list = function() return run "$luarocks list" end, |
85 | fail_bad_sysconfig = function() | 85 | fail_sysconfig_err = function() |
86 | mkdir "$testing_lrprefix/etc/luarocks" | 86 | mkdir "$testing_lrprefix/etc/luarocks" |
87 | file_set_contents("$testing_lrprefix/etc/luarocks/config.lua", "aoeui") | 87 | file_set_contents("$testing_lrprefix/etc/luarocks/config.lua", "aoeui") |
88 | return run "$luarocks list" | 88 | return run "$luarocks list" |
89 | and rm "$testing_lrprefix/etc/luarocks/config.lua" | 89 | and rm "$testing_lrprefix/etc/luarocks/config.lua" |
90 | end, | 90 | end, |
91 | fail_sysconfig_default_err = function() | ||
92 | mkdir "$testing_lrprefix/etc/luarocks" | ||
93 | file_set_contents("$testing_lrprefix/etc/luarocks/config-$luashortversion.lua", "aoeui") | ||
94 | return run "$luarocks list" | ||
95 | and rm "$testing_lrprefix/etc/luarocks/config-$luashortversion.lua" | ||
96 | end, | ||
91 | fail_build_noarg = function() return run "$luarocks build" end, | 97 | fail_build_noarg = function() return run "$luarocks build" end, |
92 | fail_download_noarg = function() return run "$luarocks download" end, | 98 | fail_download_noarg = function() return run "$luarocks download" end, |
93 | fail_install_noarg = function() return run "$luarocks install" end, | 99 | fail_install_noarg = function() return run "$luarocks install" end, |
diff --git a/test/testing.sh b/test/testing.sh index 5c839d0b..45f16c0c 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -30,6 +30,8 @@ then | |||
30 | shift | 30 | shift |
31 | fi | 31 | fi |
32 | 32 | ||
33 | luashortversion=`echo $luaversion | cut -d. -f 1-2` | ||
34 | |||
33 | testing_dir="$PWD" | 35 | testing_dir="$PWD" |
34 | 36 | ||
35 | testing_lrprefix="$testing_dir/testing_lrprefix-$luaversion" | 37 | testing_lrprefix="$testing_dir/testing_lrprefix-$luaversion" |
@@ -342,7 +344,8 @@ fail_arg_string_unknown() { $luarocks --invalid-flag=abc; } | |||
342 | 344 | ||
343 | test_empty_list() { $luarocks list; } | 345 | test_empty_list() { $luarocks list; } |
344 | 346 | ||
345 | fail_bad_sysconfig() { local err=0; local scdir="$testing_lrprefix/etc/luarocks/"; mkdir -p "$scdir"; local sysconfig="$scdir/config.lua"; echo "aoeui" > "$sysconfig"; echo $sysconfig; $luarocks list; err=$?; rm "$sysconfig"; return "$err"; } | 347 | fail_sysconfig_err() { local err=0; local scdir="$testing_lrprefix/etc/luarocks/"; mkdir -p "$scdir"; local sysconfig="$scdir/config.lua"; echo "aoeui" > "$sysconfig"; echo $sysconfig; $luarocks list; err=$?; rm "$sysconfig"; return "$err"; } |
348 | fail_sysconfig_default_err() { local err=0; local scdir="$testing_lrprefix/etc/luarocks/"; mkdir -p "$scdir"; local sysconfig="$scdir/config-$luashortversion.lua"; echo "aoeui" > "$sysconfig"; echo $sysconfig; $luarocks list; err=$?; rm "$sysconfig"; return "$err"; } | ||
346 | 349 | ||
347 | fail_build_noarg() { $luarocks build; } | 350 | fail_build_noarg() { $luarocks build; } |
348 | fail_download_noarg() { $luarocks download; } | 351 | fail_download_noarg() { $luarocks download; } |