diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-26 12:31:19 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-02-26 12:31:19 -0300 |
| commit | cda1078b7cfa7d9bc822074a54aa4f54e7a3eb27 (patch) | |
| tree | e97eb413edd92df4825b7b778813909da4c1c66f /spec/quick | |
| parent | b65f5304f224ce7f9edd0faa2bbd152dc8f8ddf2 (diff) | |
| download | luarocks-tests-more-quick.tar.gz luarocks-tests-more-quick.tar.bz2 luarocks-tests-more-quick.zip | |
tests: replace some more tests with quick teststests-more-quick
Diffstat (limited to 'spec/quick')
| -rw-r--r-- | spec/quick/install.q | 257 |
1 files changed, 254 insertions, 3 deletions
diff --git a/spec/quick/install.q b/spec/quick/install.q index 2bccf2f1..ab576605 100644 --- a/spec/quick/install.q +++ b/spec/quick/install.q | |||
| @@ -1,5 +1,91 @@ | |||
| 1 | SUITE: luarocks install | ||
| 2 | |||
| 3 | =============================================================================== | ||
| 4 | TEST: fails with no flags or arguments | ||
| 5 | RUN: luarocks install | ||
| 6 | EXIT: 1 | ||
| 7 | |||
| 8 | |||
| 9 | |||
| 10 | =============================================================================== | ||
| 11 | TEST: fails with an unknown rock | ||
| 12 | RUN: luarocks install aoeuaoeuaoeiaoeuaoeua | ||
| 13 | EXIT: 1 | ||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | =============================================================================== | ||
| 18 | TEST: fails with an invalid .rock argument | ||
| 19 | RUN: luarocks install "invalid.rock" | ||
| 20 | EXIT: 1 | ||
| 21 | |||
| 22 | |||
| 23 | |||
| 24 | =============================================================================== | ||
| 25 | TEST: fails with incompatible architecture | ||
| 26 | RUN: luarocks install foo-1.0-1.impossible-x86.rock | ||
| 27 | EXIT: 1 | ||
| 28 | STDERR: | ||
| 29 | -------------------------------------------------------------------------------- | ||
| 30 | Incompatible architecture | ||
| 31 | -------------------------------------------------------------------------------- | ||
| 32 | |||
| 33 | |||
| 34 | |||
| 1 | =============================================================================== | 35 | =============================================================================== |
| 2 | TEST: luarocks install: handle versioned modules when installing another version with --keep #268 | 36 | TEST: fails if not a zip file |
| 37 | |||
| 38 | FILE: not_a_zipfile-1.0-1.src.rock | ||
| 39 | -------------------------------------------------------------------------------- | ||
| 40 | I am not a zip file! | ||
| 41 | -------------------------------------------------------------------------------- | ||
| 42 | RUN: luarocks install not_a_zipfile-1.0-1.src.rock | ||
| 43 | EXIT: 1 | ||
| 44 | |||
| 45 | |||
| 46 | |||
| 47 | =============================================================================== | ||
| 48 | TEST: fails with an invalid patch | ||
| 49 | |||
| 50 | FILE: invalid_patch-0.1-1.rockspec | ||
| 51 | -------------------------------------------------------------------------------- | ||
| 52 | package = "invalid_patch" | ||
| 53 | version = "0.1-1" | ||
| 54 | source = { | ||
| 55 | -- any valid URL | ||
| 56 | url = "https://raw.github.com/keplerproject/luarocks/master/src/luarocks/build.lua" | ||
| 57 | } | ||
| 58 | description = { | ||
| 59 | summary = "A rockspec with an invalid patch", | ||
| 60 | } | ||
| 61 | dependencies = { | ||
| 62 | "lua >= 5.1" | ||
| 63 | } | ||
| 64 | build = { | ||
| 65 | type = "builtin", | ||
| 66 | modules = { | ||
| 67 | build = "build.lua" | ||
| 68 | }, | ||
| 69 | patches = { | ||
| 70 | ["I_am_an_invalid_patch.patch"] = | ||
| 71 | [[ | ||
| 72 | diff -Naur luadoc-3.0.1/src/luadoc/doclet/html.lua luadoc-3.0.1-new/src/luadoc/doclet/html.lua | ||
| 73 | --- luadoc-3.0.1/src/luadoc/doclet/html.lua2007-12-21 15:50:48.000000000 -0200 | ||
| 74 | +++ luadoc-3.0.1-new/src/luadoc/doclet/html.lua2008-02-28 01:59:53.000000000 -0300 | ||
| 75 | @@ -18,6 +18,7 @@ | ||
| 76 | - gabba gabba gabba | ||
| 77 | + gobo gobo gobo | ||
| 78 | ]] | ||
| 79 | } | ||
| 80 | } | ||
| 81 | -------------------------------------------------------------------------------- | ||
| 82 | RUN: luarocks invalid_patch-0.1-1.rockspec | ||
| 83 | EXIT: 1 | ||
| 84 | |||
| 85 | |||
| 86 | |||
| 87 | ================================================================================ | ||
| 88 | TEST: handle versioned modules when installing another version with --keep #268 | ||
| 3 | 89 | ||
| 4 | FILE: myrock-1.0-1.rockspec | 90 | FILE: myrock-1.0-1.rockspec |
| 5 | -------------------------------------------------------------------------------- | 91 | -------------------------------------------------------------------------------- |
| @@ -56,8 +142,8 @@ NOT_EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/myrock_1_0_1-rock.lua | |||
| 56 | 142 | ||
| 57 | 143 | ||
| 58 | 144 | ||
| 59 | =============================================================================== | 145 | ================================================================================ |
| 60 | TEST: luarocks install: handle versioned libraries when installing another version with --keep #268 | 146 | TEST: handle versioned libraries when installing another version with --keep #268 |
| 61 | 147 | ||
| 62 | FILE: myrock-1.0-1.rockspec | 148 | FILE: myrock-1.0-1.rockspec |
| 63 | -------------------------------------------------------------------------------- | 149 | -------------------------------------------------------------------------------- |
| @@ -122,3 +208,168 @@ RUN: luarocks install ./myrock-2.0-1.%{platform}.rock | |||
| 122 | 208 | ||
| 123 | EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/c_module.%{lib_extension} | 209 | EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/c_module.%{lib_extension} |
| 124 | NOT_EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/myrock_1_0_1-c_module.%{lib_extension} | 210 | NOT_EXISTS: %{testing_sys_tree}/lib/lua/%{LUA_VERSION}/myrock_1_0_1-c_module.%{lib_extension} |
| 211 | |||
| 212 | |||
| 213 | |||
| 214 | ================================================================================ | ||
| 215 | TEST: installs a package with a bin entry | ||
| 216 | |||
| 217 | FILE: myrock-1.0-1.rockspec | ||
| 218 | -------------------------------------------------------------------------------- | ||
| 219 | rockspec_format = "3.0" | ||
| 220 | package = "myrock" | ||
| 221 | version = "1.0-1" | ||
| 222 | source = { | ||
| 223 | url = "file://%{url(tmpdir)}/rock.lua" | ||
| 224 | } | ||
| 225 | build = { | ||
| 226 | modules = { rock = "rock.lua" }, | ||
| 227 | install = { | ||
| 228 | bin = { | ||
| 229 | ["scripty"] = "rock.lua", | ||
| 230 | } | ||
| 231 | } | ||
| 232 | } | ||
| 233 | -------------------------------------------------------------------------------- | ||
| 234 | |||
| 235 | FILE: rock.lua | ||
| 236 | -------------------------------------------------------------------------------- | ||
| 237 | return "hello" | ||
| 238 | -------------------------------------------------------------------------------- | ||
| 239 | |||
| 240 | RUN: luarocks build myrock-1.0-1.rockspec | ||
| 241 | EXISTS: %{testing_sys_tree}/bin/scripty%{wrapper_extension} | ||
| 242 | RUN: luarocks pack myrock | ||
| 243 | RUN: luarocks remove myrock | ||
| 244 | NOT_EXISTS: %{testing_sys_tree}/bin/scripty%{wrapper_extension} | ||
| 245 | |||
| 246 | RUN: luarocks install myrock-1.0-1.all.rock | ||
| 247 | EXISTS: %{testing_sys_tree}/bin/scripty%{wrapper_extension} | ||
| 248 | |||
| 249 | |||
| 250 | |||
| 251 | ================================================================================ | ||
| 252 | TEST: installs a package without its documentation using --no-doc | ||
| 253 | |||
| 254 | FILE: myrock-1.0-1.rockspec | ||
| 255 | -------------------------------------------------------------------------------- | ||
| 256 | rockspec_format = "3.0" | ||
| 257 | package = "myrock" | ||
| 258 | version = "1.0-1" | ||
| 259 | source = { | ||
| 260 | url = "." | ||
| 261 | } | ||
| 262 | build = { | ||
| 263 | modules = { rock = "rock.lua" }, | ||
| 264 | install = { | ||
| 265 | bin = { | ||
| 266 | ["scripty"] = "rock.lua", | ||
| 267 | } | ||
| 268 | } | ||
| 269 | } | ||
| 270 | -------------------------------------------------------------------------------- | ||
| 271 | |||
| 272 | FILE: rock.lua | ||
| 273 | -------------------------------------------------------------------------------- | ||
| 274 | return "hello" | ||
| 275 | -------------------------------------------------------------------------------- | ||
| 276 | |||
| 277 | FILE: doc/something | ||
| 278 | -------------------------------------------------------------------------------- | ||
| 279 | a doc | ||
| 280 | -------------------------------------------------------------------------------- | ||
| 281 | |||
| 282 | RUN: luarocks make | ||
| 283 | EXISTS: %{testing_sys_rocks}/myrock/1.0-1/doc/something | ||
| 284 | RUN: luarocks pack myrock | ||
| 285 | RUN: luarocks remove myrock | ||
| 286 | NOT_EXISTS: %{testing_sys_rocks}/myrock/1.0-1/doc/something | ||
| 287 | |||
| 288 | RUN: luarocks install myrock-1.0-1.all.rock | ||
| 289 | EXISTS: %{testing_sys_rocks}/myrock/1.0-1/doc/something | ||
| 290 | RUN: luarocks remove myrock | ||
| 291 | NOT_EXISTS: %{testing_sys_rocks}/myrock/1.0-1/doc/something | ||
| 292 | |||
| 293 | RUN: luarocks install myrock-1.0-1.all.rock --no-doc | ||
| 294 | NOT_EXISTS: %{testing_sys_rocks}/myrock/1.0-1/doc/something | ||
| 295 | |||
| 296 | |||
| 297 | |||
| 298 | ================================================================================ | ||
| 299 | TEST: handle non-Lua files in build.install.lua when upgrading sailorproject/sailor#138 | ||
| 300 | |||
| 301 | FILE: myrock-1.0-1.rockspec | ||
| 302 | -------------------------------------------------------------------------------- | ||
| 303 | rockspec_format = "3.0" | ||
| 304 | package = "myrock" | ||
| 305 | version = "1.0-1" | ||
| 306 | source = { | ||
| 307 | url = "." | ||
| 308 | } | ||
| 309 | build = { | ||
| 310 | modules = { | ||
| 311 | rock = "rock.lua", | ||
| 312 | }, | ||
| 313 | install = { | ||
| 314 | lua = { | ||
| 315 | ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", | ||
| 316 | } | ||
| 317 | } | ||
| 318 | } | ||
| 319 | -------------------------------------------------------------------------------- | ||
| 320 | |||
| 321 | FILE: myrock-1.0-2.rockspec | ||
| 322 | -------------------------------------------------------------------------------- | ||
| 323 | rockspec_format = "3.0" | ||
| 324 | package = "myrock" | ||
| 325 | version = "1.0-2" | ||
| 326 | source = { | ||
| 327 | url = "." | ||
| 328 | } | ||
| 329 | build = { | ||
| 330 | modules = { | ||
| 331 | rock = "rock.lua", | ||
| 332 | }, | ||
| 333 | install = { | ||
| 334 | lua = { | ||
| 335 | ["sailor.blank-app.htaccess"] = "src/sailor/blank-app/.htaccess", | ||
| 336 | } | ||
| 337 | } | ||
| 338 | } | ||
| 339 | -------------------------------------------------------------------------------- | ||
| 340 | |||
| 341 | FILE: rock.lua | ||
| 342 | -------------------------------------------------------------------------------- | ||
| 343 | return "hello" | ||
| 344 | -------------------------------------------------------------------------------- | ||
| 345 | |||
| 346 | FILE: src/sailor/blank-app/.htaccess | ||
| 347 | -------------------------------------------------------------------------------- | ||
| 348 | # I am just a file | ||
| 349 | -------------------------------------------------------------------------------- | ||
| 350 | |||
| 351 | Prepare two versions as .rock packages with the same non-Lua asset: | ||
| 352 | |||
| 353 | RUN: luarocks make ./myrock-1.0-1.rockspec | ||
| 354 | RUN: luarocks pack myrock | ||
| 355 | RUN: luarocks remove myrock | ||
| 356 | |||
| 357 | RUN: luarocks make ./myrock-1.0-2.rockspec | ||
| 358 | RUN: luarocks pack myrock | ||
| 359 | RUN: luarocks remove myrock | ||
| 360 | |||
| 361 | Now install the first one, and check that the asset was installed, with no "~" | ||
| 362 | backup leftover: | ||
| 363 | |||
| 364 | RUN: luarocks install myrock-1.0-1.all.rock --no-doc | ||
| 365 | |||
| 366 | EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/sailor/blank-app/.htaccess | ||
| 367 | NOT_EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/sailor/blank-app/.htaccess~ | ||
| 368 | |||
| 369 | Then install the second one, and the asset should be replaced, again with no | ||
| 370 | "~" backup leftover: | ||
| 371 | |||
| 372 | RUN: luarocks install myrock-1.0-2.all.rock --no-doc | ||
| 373 | |||
| 374 | EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/sailor/blank-app/.htaccess | ||
| 375 | NOT_EXISTS: %{testing_sys_tree}/share/lua/%{LUA_VERSION}/sailor/blank-app/.htaccess~ | ||
