aboutsummaryrefslogtreecommitdiff
path: root/spec/quick/build.q
diff options
context:
space:
mode:
Diffstat (limited to 'spec/quick/build.q')
-rw-r--r--spec/quick/build.q122
1 files changed, 122 insertions, 0 deletions
diff --git a/spec/quick/build.q b/spec/quick/build.q
new file mode 100644
index 00000000..c6ca433c
--- /dev/null
+++ b/spec/quick/build.q
@@ -0,0 +1,122 @@
1TEST: luarocks build: fails when given invalid argument
2RUN: luarocks build aoesuthaoeusahtoeustnaou --only-server=localhost
3EXIT: 1
4STDERR:
5--------------------------------------------------------------------------------
6Could not find a result named aoesuthaoeusahtoeustnaou
7--------------------------------------------------------------------------------
8
9
10
11================================================================================
12TEST: luarocks build: with no arguments behaves as luarocks make
13
14FILE: c_module-1.0-1.rockspec
15--------------------------------------------------------------------------------
16package = "c_module"
17version = "1.0-1"
18source = {
19 url = "http://example.com/c_module"
20}
21build = {
22 type = "builtin",
23 modules = {
24 c_module = { "c_module.c" }
25 }
26}
27--------------------------------------------------------------------------------
28FILE: c_module.c
29--------------------------------------------------------------------------------
30#include <lua.h>
31#include <lauxlib.h>
32
33int luaopen_c_module(lua_State* L) {
34 lua_newtable(L);
35 lua_pushinteger(L, 1);
36 lua_setfield(L, -2, "c_module");
37 return 1;
38}
39--------------------------------------------------------------------------------
40RUN: luarocks build
41EXISTS: c_module.%{lib_extension}
42
43
44
45================================================================================
46TEST: luarocks build: defaults to builtin type
47
48FILE: a_rock-1.0-1.rockspec
49--------------------------------------------------------------------------------
50rockspec_format = "3.0"
51package = "a_rock"
52version = "1.0-1"
53source = {
54 url = "file://%{url(%{fixtures_dir})}/a_rock.lua"
55}
56description = {
57 summary = "An example rockspec",
58}
59dependencies = {
60 "lua >= 5.1"
61}
62build = {
63 modules = {
64 build = "a_rock.lua"
65 },
66}
67--------------------------------------------------------------------------------
68RUN: luarocks build a_rock-1.0-1.rockspec
69RUN: luarocks show a_rock
70STDOUT:
71--------------------------------------------------------------------------------
72a_rock 1.0
73--------------------------------------------------------------------------------
74
75
76================================================================================
77TEST: luarocks build: fails if no permissions to access the specified tree #unix
78
79RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec
80EXIT: 4
81STDERR:
82--------------------------------------------------------------------------------
83requires exclusive access
84use --force-lock
85--------------------------------------------------------------------------------
86
87NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec
88
89RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec --force-lock
90EXIT: 4
91STDERR:
92--------------------------------------------------------------------------------
93requires exclusive access
94failed to force the lock
95--------------------------------------------------------------------------------
96
97NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec
98
99
100
101================================================================================
102TEST: luarocks build: fails if no permissions to access the parent #unix
103
104RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec
105EXIT: 4
106STDERR:
107--------------------------------------------------------------------------------
108requires exclusive access
109use --force-lock
110--------------------------------------------------------------------------------
111
112NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec
113
114RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec --force-lock
115EXIT: 4
116STDERR:
117--------------------------------------------------------------------------------
118requires exclusive access
119failed to force the lock
120--------------------------------------------------------------------------------
121
122NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec