aboutsummaryrefslogtreecommitdiff
path: root/spec/quick
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-02-28 11:49:34 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-02-29 15:31:46 +0000
commit3f0f3028321154cbacecd6690833d0e8c805ccd8 (patch)
tree76150d9b8cc50f89fa32d5716a26b6261f4e087e /spec/quick
parent6f07395f37459d7e0c2732888a1f7312fea0c67c (diff)
downloadluarocks-3f0f3028321154cbacecd6690833d0e8c805ccd8.tar.gz
luarocks-3f0f3028321154cbacecd6690833d0e8c805ccd8.tar.bz2
luarocks-3f0f3028321154cbacecd6690833d0e8c805ccd8.zip
feat: more informative reports no bad LUA_{INC,LIB}DIR configs
Diffstat (limited to 'spec/quick')
-rw-r--r--spec/quick/cmd.q36
-rw-r--r--spec/quick/config.q90
2 files changed, 121 insertions, 5 deletions
diff --git a/spec/quick/cmd.q b/spec/quick/cmd.q
new file mode 100644
index 00000000..acde92b4
--- /dev/null
+++ b/spec/quick/cmd.q
@@ -0,0 +1,36 @@
1SUITE: luarocks CLI
2
3================================================================================
4TEST: warns but continues if given an invalid version
5
6RUN: luarocks --lua-version 1.0
7
8STDOUT:
9--------------------------------------------------------------------------------
10Version : 1.0
11LUA : (interpreter not found)
12--------------------------------------------------------------------------------
13
14
15
16================================================================================
17TEST: reports if lua.h header is not found
18
19RUN: luarocks LUA_INCDIR=/bad/dir
20
21STDOUT:
22--------------------------------------------------------------------------------
23LUA_INCDIR : /bad/dir (lua.h not found)
24--------------------------------------------------------------------------------
25
26
27
28================================================================================
29TEST: reports if Lua library is not found
30
31RUN: luarocks LUA_LIBDIR=/bad/dir
32
33STDOUT:
34--------------------------------------------------------------------------------
35LUA_LIBDIR : /bad/dir (Lua library itself not found)
36--------------------------------------------------------------------------------
diff --git a/spec/quick/config.q b/spec/quick/config.q
index 3150a9ce..d6230567 100644
--- a/spec/quick/config.q
+++ b/spec/quick/config.q
@@ -1,13 +1,11 @@
1================================================================================ 1SUITE: luarocks config
2TEST: luarocks config --system-config shows the path of the system config
3 2
4MKDIR: %{testing_lrprefix}/etc/luarocks 3================================================================================
4TEST: --system-config shows the path of the system config
5 5
6FILE: %{testing_lrprefix}/etc/luarocks/config-%{LUA_VERSION}.lua 6FILE: %{testing_lrprefix}/etc/luarocks/config-%{LUA_VERSION}.lua
7-------------------------------------------------------------------------------- 7--------------------------------------------------------------------------------
8
9-------------------------------------------------------------------------------- 8--------------------------------------------------------------------------------
10
11RUN: luarocks config --system-config 9RUN: luarocks config --system-config
12 10
13STDOUT: 11STDOUT:
@@ -15,3 +13,85 @@ STDOUT:
15%{path(%{testing_lrprefix}/etc/luarocks/config-%{LUA_VERSION}.lua)} 13%{path(%{testing_lrprefix}/etc/luarocks/config-%{LUA_VERSION}.lua)}
16-------------------------------------------------------------------------------- 14--------------------------------------------------------------------------------
17 15
16
17
18================================================================================
19TEST: reports when setting a bad LUA_LIBDIR
20
21RUN: luarocks config variables.LUA_LIBDIR /some/bad/path
22
23LuaRocks writes configuration values as they are given, without auto-conversion
24of slashes for Windows:
25
26STDOUT:
27--------------------------------------------------------------------------------
28Wrote
29variables.LUA_LIBDIR = "/some/bad/path"
30--------------------------------------------------------------------------------
31
32STDERR:
33--------------------------------------------------------------------------------
34Warning: Failed finding the Lua library.
35Tried:
36
37LuaRocks may not work correctly when building C modules using this configuration.
38--------------------------------------------------------------------------------
39
40
41
42================================================================================
43TEST: reports when setting a bad LUA_INCDIR
44
45RUN: luarocks config variables.LUA_INCDIR /some/bad/path
46
47STDOUT:
48--------------------------------------------------------------------------------
49Wrote
50variables.LUA_INCDIR = "/some/bad/path"
51--------------------------------------------------------------------------------
52
53LuaRocks uses configuration values as they are given, without auto-conversion
54of slashes for Windows:
55
56STDERR:
57--------------------------------------------------------------------------------
58Warning: Failed finding Lua header lua.h (searched at /some/bad/path). You may need to install Lua development headers.
59
60LuaRocks may not work correctly when building C modules using this configuration.
61--------------------------------------------------------------------------------
62
63
64
65================================================================================
66TEST: rejects setting bad lua_dir
67
68RUN: luarocks config lua_dir /some/bad/dir
69EXIT: 1
70
71STDERR:
72--------------------------------------------------------------------------------
73Lua interpreter not found
74--------------------------------------------------------------------------------
75
76
77
78================================================================================
79TEST: reports when setting a bad LUA_INCDIR
80
81RUN: luarocks config variables.LUA_INCDIR /some/bad/path
82
83STDOUT:
84--------------------------------------------------------------------------------
85Wrote
86variables.LUA_INCDIR = "/some/bad/path"
87--------------------------------------------------------------------------------
88
89LuaRocks uses configuration values as they are given, without auto-conversion
90of slashes for Windows:
91
92STDERR:
93--------------------------------------------------------------------------------
94Warning: Failed finding Lua header lua.h (searched at /some/bad/path). You may need to install Lua development headers.
95
96LuaRocks may not work correctly when building C modules using this configuration.
97--------------------------------------------------------------------------------