aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2024-03-13 12:38:49 -0300
committerHisham Muhammad <hisham@gobolinux.org>2024-03-13 17:00:22 +0000
commit36d93bdf7ab347c4bf30aa84afd365c0f451b7b9 (patch)
tree403621587989614091ba0b68bf5c43ac01e47195
parenteffe66976ef2b48d51bca3584964bd7159a4f21f (diff)
downloadluarocks-36d93bdf7ab347c4bf30aa84afd365c0f451b7b9.tar.gz
luarocks-36d93bdf7ab347c4bf30aa84afd365c0f451b7b9.tar.bz2
luarocks-36d93bdf7ab347c4bf30aa84afd365c0f451b7b9.zip
tests: convert downgrade test to spec/quick
-rw-r--r--spec/build_spec.lua6
-rw-r--r--spec/quick/build.q46
2 files changed, 46 insertions, 6 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 00eac2e1..08a9c93f 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -210,12 +210,6 @@ describe("LuaRocks build #integration", function()
210 end) 210 end)
211 end 211 end
212 212
213 it("downgrades directories correctly", function()
214 assert(run.luarocks_bool("build --nodeps busted 2.0.0" ))
215 assert(run.luarocks_bool("build --nodeps busted 2.0.rc13" ))
216 assert(run.luarocks_bool("build --nodeps busted 2.0.0" ))
217 end)
218
219 it("only deps", function() 213 it("only deps", function()
220 local rockspec = testing_paths.fixtures_dir .. "/build_only_deps-0.1-1.rockspec" 214 local rockspec = testing_paths.fixtures_dir .. "/build_only_deps-0.1-1.rockspec"
221 215
diff --git a/spec/quick/build.q b/spec/quick/build.q
index 6d7c4744..4d0f6f9f 100644
--- a/spec/quick/build.q
+++ b/spec/quick/build.q
@@ -349,3 +349,49 @@ rock_manifest = {
349-------------------------------------------------------------------------------- 349--------------------------------------------------------------------------------
350 350
351EXISTS: ./lua_modules/bin/my_module.lua%{wrapper_extension} 351EXISTS: ./lua_modules/bin/my_module.lua%{wrapper_extension}
352
353
354
355================================================================================
356TEST: downgrades directories correctly
357
358FILE: mytest-1.0-1.rockspec
359--------------------------------------------------------------------------------
360rockspec_format = "3.0"
361package = "mytest"
362version = "1.0-1"
363source = {
364 url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz",
365 dir = "an_upstream_tarball-0.1",
366}
367build = {
368 modules = {
369 ["parent.child.my_module"] = "src/my_module.lua"
370 },
371}
372--------------------------------------------------------------------------------
373
374FILE: mytest-2.0-1.rockspec
375--------------------------------------------------------------------------------
376rockspec_format = "3.0"
377package = "mytest"
378version = "2.0-1"
379source = {
380 url = "file://%{url(%{fixtures_dir})}/an_upstream_tarball-0.1.tar.gz",
381 dir = "an_upstream_tarball-0.1",
382}
383build = {
384 modules = {
385 ["parent.child.my_module"] = "src/my_module.lua"
386 },
387}
388--------------------------------------------------------------------------------
389
390RUN: luarocks build ./mytest-2.0-1.rockspec
391EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/parent/child/my_module.lua
392
393RUN: luarocks build ./mytest-1.0-1.rockspec
394EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/parent/child/my_module.lua
395
396RUN: luarocks build ./mytest-2.0-1.rockspec
397EXISTS: %{testing_sys_tree}/share/lua/%{lua_version}/parent/child/my_module.lua