diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2022-04-11 19:16:10 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-04-12 13:19:12 -0300 |
commit | 238ba6b21cfcb1af56f1e70dd50de201fc3482a7 (patch) | |
tree | c948b6d3e12e3a518a69d0c844e016c590b31825 /spec/deps_spec.lua | |
parent | df8a3cd3c957db337bfc3ab4d404c33066a24923 (diff) | |
download | luarocks-238ba6b21cfcb1af56f1e70dd50de201fc3482a7.tar.gz luarocks-238ba6b21cfcb1af56f1e70dd50de201fc3482a7.tar.bz2 luarocks-238ba6b21cfcb1af56f1e70dd50de201fc3482a7.zip |
tests: avoid repeated hardcoded package version numbers all over
Diffstat (limited to 'spec/deps_spec.lua')
-rw-r--r-- | spec/deps_spec.lua | 102 |
1 files changed, 53 insertions, 49 deletions
diff --git a/spec/deps_spec.lua b/spec/deps_spec.lua index 35fd8be5..b0064298 100644 --- a/spec/deps_spec.lua +++ b/spec/deps_spec.lua | |||
@@ -6,11 +6,11 @@ local testing_paths = test_env.testing_paths | |||
6 | test_env.unload_luarocks() | 6 | test_env.unload_luarocks() |
7 | 7 | ||
8 | local extra_rocks = { | 8 | local extra_rocks = { |
9 | "/lxsh-0.8.6-2.src.rock", | 9 | "/lxsh-${LXSH}.src.rock", |
10 | "/lxsh-0.8.6-2.rockspec", | 10 | "/lxsh-${LXSH}.rockspec", |
11 | "/luasocket-3.0rc1-2.src.rock", | 11 | "/luasocket-${LUASOCKET}.src.rock", |
12 | "/luasocket-3.0rc1-2.rockspec", | 12 | "/luasocket-${LUASOCKET}.rockspec", |
13 | "/lpeg-1.0.0-1.src.rock", | 13 | "/lpeg-${LPEG}.src.rock", |
14 | } | 14 | } |
15 | 15 | ||
16 | describe("LuaRocks deps-mode #integration", function() | 16 | describe("LuaRocks deps-mode #integration", function() |
@@ -23,92 +23,96 @@ describe("LuaRocks deps-mode #integration", function() | |||
23 | assert.is_true(run.luarocks_bool("build --tree=system lpeg")) | 23 | assert.is_true(run.luarocks_bool("build --tree=system lpeg")) |
24 | assert.is_true(run.luarocks_bool("build --deps-mode=one --tree=" .. testing_paths.testing_tree .. " lxsh")) | 24 | assert.is_true(run.luarocks_bool("build --deps-mode=one --tree=" .. testing_paths.testing_tree .. " lxsh")) |
25 | 25 | ||
26 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 26 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
27 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 27 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
28 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 28 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
29 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 29 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
30 | end) | 30 | end) |
31 | 31 | ||
32 | it("order", function() | 32 | it("order", function() |
33 | assert.is_true(run.luarocks_bool("build --tree=system lpeg")) | 33 | assert.is_true(run.luarocks_bool("build --tree=system lpeg")) |
34 | assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_tree .. " lxsh")) | 34 | assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_tree .. " lxsh")) |
35 | 35 | ||
36 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 36 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
37 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 37 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
38 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 38 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
39 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 39 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
40 | end) | 40 | end) |
41 | 41 | ||
42 | it("order sys", function() | 42 | it("order sys", function() |
43 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) | 43 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) |
44 | assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) | 44 | assert.is_true(run.luarocks_bool("build --deps-mode=order --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) |
45 | 45 | ||
46 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 46 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
47 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 47 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
48 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 48 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
49 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 49 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
50 | end) | 50 | end) |
51 | 51 | ||
52 | it("all sys", function() | 52 | it("all sys", function() |
53 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) | 53 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) |
54 | assert.is_true(run.luarocks_bool("build --deps-mode=all --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) | 54 | assert.is_true(run.luarocks_bool("build --deps-mode=all --tree=" .. testing_paths.testing_sys_tree .. " lxsh")) |
55 | 55 | ||
56 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 56 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
57 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 57 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
58 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 58 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
59 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 59 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
60 | end) | 60 | end) |
61 | 61 | ||
62 | it("none", function() | 62 | it("none", function() |
63 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) | 63 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) |
64 | assert.is_true(run.luarocks_bool("build --deps-mode=none lxsh")) | 64 | assert.is_true(run.luarocks_bool("build --deps-mode=none lxsh")) |
65 | 65 | ||
66 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 66 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
67 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 67 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
68 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 68 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
69 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 69 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
70 | end) | 70 | end) |
71 | 71 | ||
72 | it("LuaRocks nodeps alias", function() | 72 | it("LuaRocks nodeps alias", function() |
73 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " --nodeps lxsh")) | 73 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " --nodeps lxsh")) |
74 | 74 | ||
75 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 75 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
76 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 76 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
77 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 77 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
78 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 78 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
79 | end) | 79 | end) |
80 | 80 | ||
81 | it("make order", function() | 81 | it("make order", function() |
82 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_sys_tree .. " lpeg")) | 82 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_sys_tree .. " lpeg")) |
83 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6")) | 83 | assert.is_true(run.luarocks_bool("download --source lxsh ${LXSH_V}")) |
84 | assert.is_true(run.luarocks_bool("unpack lxsh-0.8.6-2.src.rock")) | 84 | assert.is_true(run.luarocks_bool("unpack lxsh-${LXSH}.src.rock")) |
85 | lfs.chdir("lxsh-0.8.6-2/lxsh-0.8.6-1/") | 85 | lfs.chdir("lxsh-${LXSH}/lxsh-${LXSH_V}-1/") |
86 | assert.is_true(run.luarocks_bool("make --tree=" .. testing_paths.testing_tree .. " --deps-mode=order")) | 86 | assert.is_true(run.luarocks_bool("make --tree=" .. testing_paths.testing_tree .. " --deps-mode=order")) |
87 | 87 | ||
88 | lfs.chdir(testing_paths.testrun_dir) | 88 | finally(function() |
89 | test_env.remove_dir("lxsh-0.8.6-2") | 89 | lfs.chdir(testing_paths.testrun_dir) |
90 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) | 90 | test_env.remove_dir("lxsh-${LXSH}") |
91 | assert.is_true(os.remove("lxsh-${LXSH}.src.rock")) | ||
92 | end) | ||
91 | 93 | ||
92 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 94 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
93 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 95 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
94 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 96 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
95 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 97 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
96 | end) | 98 | end) |
97 | 99 | ||
98 | it("make order sys", function() | 100 | it("make order sys", function() |
99 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) | 101 | assert.is_true(run.luarocks_bool("build --tree=" .. testing_paths.testing_tree .. " lpeg")) |
100 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6")) | 102 | assert.is_true(run.luarocks_bool("download --source lxsh ${LXSH_V}")) |
101 | assert.is_true(run.luarocks_bool("unpack lxsh-0.8.6-2.src.rock")) | 103 | assert.is_true(run.luarocks_bool("unpack lxsh-${LXSH}.src.rock")) |
102 | lfs.chdir("lxsh-0.8.6-2/lxsh-0.8.6-1/") | 104 | lfs.chdir("lxsh-${LXSH}/lxsh-${LXSH_V}-1/") |
103 | assert.is_true(run.luarocks_bool("make --tree=" .. testing_paths.testing_sys_tree .. " --deps-mode=order")) | 105 | assert.is_true(run.luarocks_bool("make --tree=" .. testing_paths.testing_sys_tree .. " --deps-mode=order")) |
104 | 106 | ||
105 | lfs.chdir(testing_paths.testrun_dir) | 107 | finally(function() |
106 | test_env.remove_dir("lxsh-0.8.6-2") | 108 | lfs.chdir(testing_paths.testrun_dir) |
107 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) | 109 | test_env.remove_dir("lxsh-${LXSH}") |
110 | assert.is_true(os.remove("lxsh-${LXSH}.src.rock")) | ||
111 | end) | ||
108 | 112 | ||
109 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 113 | assert.is.truthy(lfs.attributes(testing_paths.testing_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
110 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | 114 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lpeg/${LPEG}/lpeg-${LPEG}.rockspec")) |
111 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 115 | assert.is.falsy(lfs.attributes(testing_paths.testing_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
112 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) | 116 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/lxsh/${LXSH}/lxsh-${LXSH}.rockspec")) |
113 | end) | 117 | end) |
114 | end) | 118 | end) |