summaryrefslogtreecommitdiff
path: root/spec/quick/make.q
diff options
context:
space:
mode:
authorMike Vink <mike@pionative.com>2025-02-03 21:29:42 +0100
committerMike Vink <mike@pionative.com>2025-02-03 21:29:42 +0100
commit5155816b7b925dec5d5feb1568b1d7ceb00938b9 (patch)
treedeca28ea15e79f6f804c3d90d2ba757881638af5 /spec/quick/make.q
fetch tarballHEADmaster
Diffstat (limited to 'spec/quick/make.q')
-rw-r--r--spec/quick/make.q88
1 files changed, 88 insertions, 0 deletions
diff --git a/spec/quick/make.q b/spec/quick/make.q
new file mode 100644
index 0000000..eb3472b
--- /dev/null
+++ b/spec/quick/make.q
@@ -0,0 +1,88 @@
+SUITE: luarocks make
+
+================================================================================
+TEST: overrides luarocks.lock with --pin #pinning
+
+FILE: test-2.0-1.rockspec
+--------------------------------------------------------------------------------
+package = "test"
+version = "2.0-1"
+source = {
+ url = "file://%{path(tmpdir)}/test.lua"
+}
+dependencies = {
+ "a_rock >= 0.8"
+}
+build = {
+ type = "builtin",
+ modules = {
+ test = "test.lua"
+ }
+}
+--------------------------------------------------------------------------------
+
+FILE: test.lua
+--------------------------------------------------------------------------------
+return {}
+--------------------------------------------------------------------------------
+
+FILE: luarocks.lock
+--------------------------------------------------------------------------------
+return {
+ dependencies = {
+ ["a_rock"] = "1.0-1",
+ }
+}
+--------------------------------------------------------------------------------
+
+RUN: luarocks make --only-server=%{fixtures_dir}/a_repo --pin --tree=lua_modules
+
+EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/2.0-1/test-2.0-1.rockspec
+EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/a_rock/2.0-1/a_rock-2.0-1.rockspec
+
+FILE_CONTENTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/2.0-1/luarocks.lock
+--------------------------------------------------------------------------------
+return {
+ dependencies = {
+ a_rock = "2.0-1",
+ lua = "%{lua_version}-1"
+ }
+}
+--------------------------------------------------------------------------------
+
+
+
+================================================================================
+TEST: running make twice builds twice
+
+FILE: test-2.0-1.rockspec
+--------------------------------------------------------------------------------
+package = "test"
+version = "2.0-1"
+source = {
+ url = "file://%{path(tmpdir)}/test.lua"
+}
+build = {
+ type = "builtin",
+ modules = {
+ test = "test.lua"
+ }
+}
+--------------------------------------------------------------------------------
+
+FILE: test.lua
+--------------------------------------------------------------------------------
+return {}
+--------------------------------------------------------------------------------
+
+RUN: luarocks make --only-server=%{fixtures_dir}/a_repo --pin --tree=lua_modules
+STDOUT:
+--------------------------------------------------------------------------------
+test 2.0-1 is now installed
+--------------------------------------------------------------------------------
+
+RUN: luarocks make --only-server=%{fixtures_dir}/a_repo --pin --tree=lua_modules
+STDOUT:
+--------------------------------------------------------------------------------
+test 2.0-1 is now installed
+--------------------------------------------------------------------------------