aboutsummaryrefslogtreecommitdiff
path: root/spec/quick/install.q
diff options
context:
space:
mode:
Diffstat (limited to 'spec/quick/install.q')
-rw-r--r--spec/quick/install.q124
1 files changed, 124 insertions, 0 deletions
diff --git a/spec/quick/install.q b/spec/quick/install.q
new file mode 100644
index 00000000..2bccf2f1
--- /dev/null
+++ b/spec/quick/install.q
@@ -0,0 +1,124 @@
1===============================================================================
2TEST: luarocks install: handle versioned modules when installing another version with --keep #268
3
4FILE: myrock-1.0-1.rockspec
5--------------------------------------------------------------------------------
6rockspec_format = "3.0"
7package = "myrock"
8version = "1.0-1"
9source = {
10 url = "file://%{url(tmpdir)}/rock.lua"
11}
12build = {
13 modules = { rock = "rock.lua" }
14}
15--------------------------------------------------------------------------------
16
17FILE: myrock-2.0-1.rockspec
18--------------------------------------------------------------------------------
19rockspec_format = "3.0"
20package = "myrock"
21version = "2.0-1"
22source = {
23 url = "file://%{url(tmpdir)}/rock.lua"
24}
25build = {
26 modules = { rock = "rock.lua" }
27}
28--------------------------------------------------------------------------------
29
30FILE: rock.lua
31--------------------------------------------------------------------------------
32return "hello"
33--------------------------------------------------------------------------------
34
35RUN: luarocks build myrock-1.0-1.rockspec
36RUN: luarocks pack myrock
37RUN: luarocks remove myrock
38
39RUN: luarocks build myrock-2.0-1.rockspec
40RUN: luarocks pack myrock
41RUN: luarocks remove myrock
42
43RUN: luarocks install ./myrock-2.0-1.all.rock
44
45EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/rock.lua
46
47RUN: luarocks install ./myrock-1.0-1.all.rock --keep
48
49EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/rock.lua
50EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/myrock_1_0_1-rock.lua
51
52RUN: luarocks install ./myrock-2.0-1.all.rock
53
54EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/rock.lua
55NOT_EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/myrock_1_0_1-rock.lua
56
57
58
59===============================================================================
60TEST: luarocks install: handle versioned libraries when installing another version with --keep #268
61
62FILE: myrock-1.0-1.rockspec
63--------------------------------------------------------------------------------
64rockspec_format = "3.0"
65package = "myrock"
66version = "1.0-1"
67source = {
68 url = "file://%{url(tmpdir)}/c_module.c"
69}
70build = {
71 modules = {
72 c_module = { "c_module.c" }
73 }
74}
75--------------------------------------------------------------------------------
76
77FILE: myrock-2.0-1.rockspec
78--------------------------------------------------------------------------------
79rockspec_format = "3.0"
80package = "myrock"
81version = "2.0-1"
82source = {
83 url = "file://%{url(tmpdir)}/c_module.c"
84}
85build = {
86 modules = {
87 c_module = { "c_module.c" }
88 }
89}
90--------------------------------------------------------------------------------
91FILE: c_module.c
92--------------------------------------------------------------------------------
93#include <lua.h>
94#include <lauxlib.h>
95
96int luaopen_c_module(lua_State* L) {
97 lua_newtable(L);
98 lua_pushinteger(L, 1);
99 lua_setfield(L, -2, "c_module");
100 return 1;
101}
102--------------------------------------------------------------------------------
103
104RUN: luarocks build myrock-1.0-1.rockspec
105RUN: luarocks pack myrock
106RUN: luarocks remove myrock
107
108RUN: luarocks build myrock-2.0-1.rockspec
109RUN: luarocks pack myrock
110RUN: luarocks remove myrock
111
112RUN: luarocks install ./myrock-2.0-1.%{platform}.rock
113
114EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/c_module.%{lib_extension}
115
116RUN: luarocks install ./myrock-1.0-1.%{platform}.rock --keep
117
118EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/c_module.%{lib_extension}
119EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/myrock_1_0_1-c_module.%{lib_extension}
120
121RUN: luarocks install ./myrock-2.0-1.%{platform}.rock
122
123EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/c_module.%{lib_extension}
124NOT_EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/myrock_1_0_1-c_module.%{lib_extension}