diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-02-08 18:33:26 -0200 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-02-08 18:33:26 -0200 |
commit | 916f3b9afecbe6033ac2f39700e60c1ed4e0edc4 (patch) | |
tree | a535ee802b38e0039a011fdbdeb06cf450c5b9c7 | |
parent | e6ebf473e09afed69895e6501580fbc47bf13534 (diff) | |
download | luarocks-916f3b9afecbe6033ac2f39700e60c1ed4e0edc4.tar.gz luarocks-916f3b9afecbe6033ac2f39700e60c1ed4e0edc4.tar.bz2 luarocks-916f3b9afecbe6033ac2f39700e60c1ed4e0edc4.zip |
Add test for missing external deps. Improves coverage.
A bug was uncovered writing this!
-rw-r--r-- | test/testfiles/missing_external-0.1-1.rockspec | 24 | ||||
-rwxr-xr-x | test/testing.sh | 15 |
2 files changed, 38 insertions, 1 deletions
diff --git a/test/testfiles/missing_external-0.1-1.rockspec b/test/testfiles/missing_external-0.1-1.rockspec new file mode 100644 index 00000000..5f8e6219 --- /dev/null +++ b/test/testfiles/missing_external-0.1-1.rockspec | |||
@@ -0,0 +1,24 @@ | |||
1 | package = "missing_external" | ||
2 | version = "0.1-1" | ||
3 | source = { | ||
4 | -- any valid URL | ||
5 | url = "https://raw.github.com/keplerproject/luarocks/master/src/luarocks/build.lua" | ||
6 | } | ||
7 | description = { | ||
8 | summary = "Missing external dependency", | ||
9 | } | ||
10 | external_dependencies = { | ||
11 | INEXISTENT = { | ||
12 | library = "inexistentlib*", | ||
13 | header = "inexistentheader*.h", | ||
14 | } | ||
15 | } | ||
16 | dependencies = { | ||
17 | "lua >= 5.1" | ||
18 | } | ||
19 | build = { | ||
20 | type = "builtin", | ||
21 | modules = { | ||
22 | build = "build.lua" | ||
23 | } | ||
24 | } | ||
diff --git a/test/testing.sh b/test/testing.sh index a0bfeeca..5ae21d81 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -72,6 +72,18 @@ upload_servers = { | |||
72 | rsync = "localhost/tmp/luarocks_testing", | 72 | rsync = "localhost/tmp/luarocks_testing", |
73 | }, | 73 | }, |
74 | } | 74 | } |
75 | external_deps_dirs = { | ||
76 | "/usr/local", | ||
77 | "/usr", | ||
78 | -- These are used for a test that fails, so it | ||
79 | -- can point to invalid paths: | ||
80 | { | ||
81 | prefix = "/opt", | ||
82 | bin = "bin", | ||
83 | include = "include", | ||
84 | lib = { "lib", "lib64" }, | ||
85 | } | ||
86 | } | ||
75 | EOF | 87 | EOF |
76 | ( | 88 | ( |
77 | cat $testing_dir/testing_config.lua | 89 | cat $testing_dir/testing_config.lua |
@@ -327,8 +339,9 @@ test_build_diffversion() { $luarocks build luacov ${version_luacov}; } | |||
327 | test_build_command() { $luarocks build stdlib; } | 339 | test_build_command() { $luarocks build stdlib; } |
328 | test_build_install_bin() { $luarocks build luarepl; } | 340 | test_build_install_bin() { $luarocks build luarepl; } |
329 | fail_build_nohttps() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } | 341 | fail_build_nohttps() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } |
330 | test_build_https() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx && pwd && ls && $luarocks install $luasec && pwd && ls && $luarocks build ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } | 342 | test_build_https() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks install $luasec && $luarocks build ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } |
331 | test_build_supported_platforms() { $luarocks build lpty; } | 343 | test_build_supported_platforms() { $luarocks build lpty; } |
344 | fail_build_missing_external() { $luarocks build "$testing_dir/testfiles/missing_external-0.1-1.rockspec" INEXISTENT_INCDIR="/invalid/dir"; } | ||
332 | 345 | ||
333 | test_build_deps_partial_match() { $luarocks build lrandom; } | 346 | test_build_deps_partial_match() { $luarocks build lrandom; } |
334 | test_build_show_downloads() { export LUAROCKS_CONFIG="$testing_dir/testing_config_show_downloads.lua" && $luarocks build alien; export LUAROCKS_CONFIG="$testing_dir/testing_config.lua"; } | 347 | test_build_show_downloads() { export LUAROCKS_CONFIG="$testing_dir/testing_config_show_downloads.lua" && $luarocks build alien; export LUAROCKS_CONFIG="$testing_dir/testing_config.lua"; } |