1899 Commits

Author SHA1 Message Date
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
Baptiste Fontaine
9127ee1928 plural: tests added 2015-12-14 15:01:31 +01:00
Xu Cheng
ed35c18fcf test-tab: tap is a Tap object now
Closes Homebrew/homebrew#46735.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-12-09 16:57:00 +08:00
Mike McQuaid
fe8a0569ca update: always reset to origin/master.
Do a reset to `origin/master` and then stash but don't pop the stash
after running update (unless you were on a branch). This may be mildly
more annoying for Homebrew developers but means it's easier for our
users who don't understand Git (and particularly when they don't
understand that every tap is a separate Git repository).

Closes Homebrew/homebrew#45825.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-07 13:37:27 +00:00
Xu Cheng
c0f33d650f fix test_formula_pin
Closes Homebrew/homebrew#46468.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-29 20:24:30 +08:00
Xu Cheng
b124c81697 test_tab: use installed_prefixes 2015-11-29 20:24:30 +08:00
Mike McQuaid
10c79620c1 tab: use cache to avoid rereading the same files.
Closes Homebrew/homebrew#46400.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-27 16:52:54 +00:00
Daniel Trebbien
af10515f81 Skip pouring from a bottle if --cc is passed
A formula should be built from source by default if the --cc option is
passed to specify a particular compiler.

Added a test to test_formula_installer: test_not_poured_from_bottle_when_compiler_specified

Modified test_formula_installer to assert that the formula was not poured
from a bottle. Similarly modified test_formula_installer_bottle to assert
that the formula *was* installed from a bottle.

Added an install method to the TestballBottle formula (the same as the
Testball formula's install method) so that the TestballBottle formula can
be "built from source".

Fixes Homebrew/homebrew#46046 - Build from source should be the default behavior if --cc
option is passed

Closes Homebrew/homebrew#46162.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-25 16:49:58 +00:00
Martin Afanasjew
8091b33f85 ruby 1.8: address syntax warnings in Homebrew core
Closes Homebrew/homebrew#45849.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-11 14:22:44 +08:00
Xu Cheng
4ef15427ba add test for bottle disable
Closes Homebrew/homebrew#43935.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-19 21:41:36 +08:00
Baptiste Fontaine
cc7a047edc version: parse opam archives
Closes Homebrew/homebrew#44544.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-04 10:31:46 +02:00
Martin Afanasjew
37ce555104 update: fix test for non-master update support
Commit a71d4a9b (PR Homebrew/homebrew#44058) brought support for updating repositories
with a default branch different from master. This fixes the tests broken
by that commit.

Closes Homebrew/homebrew#44135.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-09-19 16:28:16 +01:00
Xu Cheng
7ea8a23eeb test_formulary: test tap alias 2015-09-13 12:58:00 +08:00
Mike McQuaid
b1ff9c42d6 update: fix when HEAD doesn't exist.
e.g. when it's a detached `HEAD` through checking out a commit rather
than a branch.
2015-09-11 11:00:27 +01:00
Mike McQuaid
0a39474bcf Add El Capitan testball bottle. 2015-09-07 15:04:16 +01:00
Josh Hagins
f431e543a5 update: explicitly no-ff merge and rebase.
This overrides user configuration which may do otherwise.

Closes Homebrew/homebrew#41570.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-07 12:05:20 +01:00
Xu Cheng
ccc7a5f1bd add test_formulary
Closes Homebrew/homebrew#43506.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-06 20:47:40 +08:00
Xu Cheng
db2552828b test_integration_cmds: fix syntax warning
Library/Homebrew/test/test_integration_cmds.rb:68: warning: ambiguous first argument; put parentheses or even spaces
2015-09-06 20:15:38 +08:00
Alex Dunn
818c65542d remove Formula#file_modified?
It's been more trouble than it's worth.

Fixes Homebrew/homebrew#43607.
Closes Homebrew/homebrew#43049.

Closes Homebrew/homebrew#43615.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-09-06 13:13:59 +01:00
Vlad Shablinsky
a29832484c fix style problems in migrator
Closes Homebrew/homebrew#43473.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-03 13:58:25 +08:00
William Woodruff
b0d5e17906 tweak String#undent so that only leading whitespace up to the first indentation level is gsubbed, change test_undent to reflect change and add test_undent_nested to test new behavior 2015-08-28 18:02:04 +08:00
Martin Afanasjew
1288e3110d update: always report changes to branch 'master'
If the user's working copy is *not* on the 'master' branch, the revision
recorded after the update to the 'master' branch is not the one of the
updated 'master' branch but that of whatever the user's current branch
is. This tends to be not very helpful.

This change records the revision *after* the update to the 'master'
branch, but *before* switching back to the user's current branch prior
to the update, effectively causing the report to show changes to the
'master' branch.

Closes Homebrew/homebrew#42074.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-27 13:53:28 +01:00
Tim D. Smith
143709e679 include git sha1 in --version output
HOMEBREW_VERSION doesn't change very often; the repository state is more
interesting.

Closes Homebrew/homebrew#41886.
2015-08-25 00:13:53 -07:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Misty De Meo
727239e12f Merge bottle install without Xcode branch
Merge branch 'bottle_hooks'
2015-08-21 11:04:22 -07:00
William Woodruff
f108d204f7 Add tests for pouring bottle without Xcode
add testball_bottle formula for upcoming bottle unit testing, as well
as bottles directory containing test bottle (and symlinks)
2015-08-21 11:02:33 -07:00
Xu Cheng
72a11b7d11 test_migrator: fix lock file leak
Closes Homebrew/homebrew#43025.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-20 15:47:42 +08:00
Baptiste Fontaine
8ba0fb9fcf unnecessary calls to .select simplified
These are minor perf optimizations.

Closes Homebrew/homebrew#43028.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-18 00:18:22 +02:00
Vlad Shablinsky
dc4feaf56b test_keg: add tests for oldname optlink
Closes Homebrew/homebrew#42998.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-17 01:53:58 +08:00
Baptiste Fontaine
ccb613df69 which: tests added
Closes Homebrew/homebrew#42954.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-16 17:03:05 +02:00
Tim D. Smith
f5642cb105 let tests pass on Xcode-only systems
Closes Homebrew/homebrew#42976.
2015-08-15 20:24:20 -07:00
Vlad Shablinsky
7079a00aa7 add test/test_migrator 2015-08-10 13:57:59 +01:00
Xu Cheng
4e5227fd4e test_formula: add test_facotry_with_fully_qualified_name
Closes Homebrew/homebrew#42550.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-06 22:28:44 +08:00
Xu Cheng
8f20ea92b3 test_inreplace: temporary disable rubocop string replacement rule 2015-08-06 17:23:56 +08:00
Xu Cheng
b121e5fd7b more core file style updated by rubocop 2015-08-06 17:23:56 +08:00
Xu Cheng
a5a1cc9865 fix ruby syntax warnings
Closes Homebrew/homebrew#42409.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-08-03 21:27:40 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Xu Cheng
8054161153 test_tab: add test for Tab#spec
Fixes Homebrew/homebrew#42147.
Closes Homebrew/homebrew#42205.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-07-31 19:44:07 +08:00
Xu Cheng
a9e71ca905 test_formula: add more test 2015-07-31 19:44:03 +08:00
Baptiste Fontaine
ea08e4fb16 KegOnlyReason: print only the explanation if there’s one
Closes Homebrew/homebrew#42073.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-07-28 20:40:28 +02:00