1238 Commits

Author SHA1 Message Date
Baptiste Fontaine
f41e0a6e64 tests: more integration tests
Closes Homebrew/homebrew#48124.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-16 15:46:01 +01:00
Xu Cheng
8deec537d1 test_download_strategies: add mtime test 2016-01-15 16:26:04 +08:00
Xu Cheng
fab16b83e9 tab: add source modified time metadata 2016-01-15 16:26:04 +08:00
Xu Cheng
9810c2a412 test_tap: restore private remote test
Only test it if HOMEBREW_GITHUB_API_TOKEN is set.
2016-01-11 22:07:15 +08:00
Xu Cheng
86cc780ea2 test_tap: remove problematic test
`Tap#private?` requires Github API, which can cause problem on Travis CI
due to API rate limit.
2016-01-11 19:47:35 +08:00
Xu Cheng
f6355c9dfc test_keg: add test_empty_installation 2016-01-09 21:09:02 +08:00
Xu Cheng
f0b22c4ce3 fix test_missing test 2016-01-09 19:11:34 +08:00
Baptiste Fontaine
f0d1444980 tests: missing requires added
Closes Homebrew/homebrew#47866.
Closes Homebrew/homebrew#47861.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-09 10:37:40 +01:00
Baptiste Fontaine
daf659cbae more utils tests
Closes Homebrew/homebrew#47856.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-09 10:37:29 +01:00
Baptiste Fontaine
beb80c605f more diagnostic tests 2016-01-09 10:37:29 +01:00
Baptiste Fontaine
5162df8f65 a few more diagnostic checks
Closes Homebrew/homebrew#47769.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-07 11:43:56 +01:00
Baptiste Fontaine
8e75375d9d diagnostic tests
Closes Homebrew/homebrew#47760.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-06 13:15:35 +01:00
Baptiste Fontaine
c8401b8243 a few more integration tests
Closes Homebrew/homebrew#47714.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-06 12:22:58 +01:00
Baptiste Fontaine
9f1442db14 doctor: move code away from cmd/
Closes Homebrew/homebrew#47665.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-05 14:33:06 +01:00
Baptiste Fontaine
5d8a6e368f integration tests: allow env overriding 2016-01-05 14:33:06 +01:00
Martin Afanasjew
c5f0003061 test: don't fail if GitHub API is unavailable
Tests shouldn't fail in case of an unavailable network or a deliberately
disabled access to the GitHub API.

Closes Homebrew/homebrew#47670.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:26:36 +01:00
Martin Afanasjew
301d88544f test: exhaustively test comparison of versions
This tests all possible combinations of alpha, beta, RC, regular, and
patch versions. Also improves code coverage and partitions the version
comparison tests into more uniform chunks.

Closes Homebrew/homebrew#47669.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-04 16:26:25 +01:00
Martin Afanasjew
74baec5e79 test: test popen_read and popen_write with block 2016-01-04 16:26:25 +01:00
Baptiste Fontaine
8f8c3cc1b1 integration tests: fix failing test
If the test fails above `formula_file`’s definition this line fails
because `formula_file` is `nil`.

Closes Homebrew/homebrew#47663.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 15:12:32 +01:00
Baptiste Fontaine
9bdd6619e2 cleanup: move code away from cmd/
Closes Homebrew/homebrew#47484.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-04 13:17:21 +01:00
Dominyk Tiller
cff0c63d03 test_intergration_cmds: fix minor typo 2016-01-03 19:06:26 +00:00
Dominyk Tiller
49f7c8d6a9 test_intergration_cmds: paren-wrap regex
Fixes this `brew readall` warning:

test_integration_cmds.rb:116: warning: ambiguous first argument; put parentheses or even spaces
2016-01-03 19:06:26 +00:00
Xu Cheng
17a57f529b test_utils: add test_which_all 2016-01-03 21:00:11 +08:00
Xiyue Deng
e1dfafa54c Improve dash separated version detection.
* Also with test case.

Closes Homebrew/homebrew#47584.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-02 20:06:17 +01:00
Misty De Meo
36cef3c974 LanguageModuleRequirement: remove node support 2016-01-01 20:10:34 -04:00
Misty De Meo
1ad2aeef86 LanguageModuleRequirement: remove chicken support 2016-01-01 20:10:34 -04:00
Misty De Meo
d4db443b19 LanguageModuleRequirement: remove rbx support
This test wasn't running by default, so we missed that it wasn't
actually being executed - or that it was failing when running in the
testing environment.

As far as I can tell this is not, and has not, been used either in core
or in any tap, third party or otherwise, so just remove the feature and
its test.
2016-01-01 20:10:34 -04:00
Misty De Meo
31501e7b38 Add more tests for DependencyCollector inferred deps 2015-12-31 19:52:41 -04:00
Xu Cheng
3d8c334660 test_utils: add test_disk_usage_readable and test_number_readable 2015-12-30 17:05:52 +08:00
Baptiste Fontaine
c15c9dbaf3 Tap#issues_url added
Closes Homebrew/homebrew#47454.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-30 00:44:46 +01:00
Baptiste Fontaine
e224c2fc9e more formula tests
Closes Homebrew/homebrew#47404.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-27 02:20:41 +01:00
Stefano Pigozzi
e865cee3d3 Fix version parsing on URLs with no extensions 2015-12-26 21:47:14 +00:00
Xu Cheng
e27bddc82a IntegrationCommandTests: improve bottle test
Also let `cmd_output` capture `$stderr`

Closes Homebrew/homebrew#47383.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-26 18:08:45 +08:00
Baptiste Fontaine
755ca5da6c blacklist tests added
Closes Homebrew/homebrew#47280.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-23 12:33:30 +01:00
Sebastian Staudt
f0a370ea12 Reimplement #pretty_duration
Also reuse this improved implementation in the GitHub rate limit errors.

Closes Homebrew/homebrew#44721.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-22 12:46:03 +01:00
Øyvind Ingebrigtsen Øvergaard
cf2bf08ec9 bottle: don't read mtime from nonexistant files
If the source contains a broken symlink, `brew bottle` would fail for no
good reason when trying to determine the most recently modified
file. To avoid this, we ignore any files for which stat(2) fails.

Closes Homebrew/homebrew#47111.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-21 07:54:30 +00:00
Xu Cheng
28776ee1c3 tests: add coveralls support
Closes Homebrew/homebrew#47185.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-21 12:14:49 +08:00
Baptiste Fontaine
a6d2723ef5 more core unit tests
Closes Homebrew/homebrew#47182.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-20 12:11:40 +01:00
Xu Cheng
f258949816 add IntergrationCommandTests#test_tap
Closes Homebrew/homebrew#47177.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-19 22:05:31 +08:00
Xu Cheng
fe2bec5e8b add IntergrationCommandTests#test_readall 2015-12-19 22:05:30 +08:00
Xu Cheng
6bb341dc24 add test_tap 2015-12-19 22:05:30 +08:00
Xu Cheng
82eb1a4c42 formulary: use CoreFormulaRepository
Let's hide implementation detail on where to find core formulae alias
directory. This will benefit future core code and formulae separation.
2015-12-19 22:05:30 +08:00
Mike McQuaid
ca3952c500 Add some more integration command tests.
Add them for `install`, `bottle`, `uninstall`, `cleanup`.

Closes Homebrew/homebrew#47079.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-18 09:14:16 +00:00
Martin Afanasjew
ea4d137e87 dependency: fix merging tags in 'merge_repeats'
While it may suffice to merge string and non-reserved tags by forming a
union of all tags of dependencies of the same name, this approach fails
to work for the reserved tags. These are now merged such that the most
restrictive tag (meaning sometimes an empty tag) is preserved.

The previous behavior caused essential dependencies to be omitted and
builds to fail in response. E.g., multiple `:fortran` dependencies with
tags `[]`, `[:recommended]`, and `[:optional]` would have been expanded
and merged to `"gcc"` with tags `[:recommended, :optional]`, causing it
to be no longer seen as a required dependency.

Closes Homebrew/homebrew#47040.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2015-12-17 13:50:38 +01:00
Martin Afanasjew
0f9abe57ea tests: add (failing) tests for merging deps tags
The general idea is that merging multiple dependencies of the same name
should produce the strictest tag instead of a (meaningless) union of the
reserved tags. For example, if a dependency is both a `:recommended` and
an `:optional` dependency at different points in the dependency tree,
the resulting merged dependency should be tagged as `:recommended`.
Handle all other reserved tags in the same spirit.
2015-12-17 13:50:38 +01:00
Martin Afanasjew
10f066197e tests: rely on fewer implementation details
These tests were using too much semi-global state (instance variables)
and relied unnecessarily on the exact number of calls to `optional?` and
`recommended?` in the `Depedable` module.
2015-12-17 13:50:38 +01:00
Mike McQuaid
e5ba31fcdc Allow multiple option_names in dep/reqs.
This means that dependencies can be merged but still maintain all
their option names.

Closes Homebrew/homebrew#46916.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-15 08:37:16 +00:00
Mike McQuaid
484c70d19f test_dependency: add failing option names test.
This test will obviously fail but it does mark that the option names
are not being merged correctly.
2015-12-15 08:37:16 +00:00
Mike McQuaid
7095378b31 Add option_name tests. 2015-12-15 08:37:16 +00:00
Baptiste Fontaine
f1ac9b5776 pretty_duration: fixed for int arguments
Without this the returned string is not as accurate if the method is
called with an int larger than 120.

Closes Homebrew/homebrew#47002.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-14 16:34:12 +01:00