1899 Commits

Author SHA1 Message Date
Martin Afanasjew
8a70b000e5 tests: fix problems in 'log with formula' test (#350)
Problems fixed:

- Broken and leaking test if run as part of `brew tests --coverage` due
  to the `cmd` call being nested in the `Pathname#cd` block.
- Output during `git clone` operation because of a missing `shutup do`.
- Still incomplete coverage for `cmd/log.rb` because `brew log` is
  invoked on the formula in the origin instead of the shallow clone.
- Minor stylistic fixes:
  - Superfluous parentheses around `core_tap.path.dirname`.
  - Overly long lines.
2016-06-14 14:58:11 +02:00
Martin Afanasjew
86538c9d6a tests: simplify SimpleCov configuration (#348)
There is no good reason to configure the options specific to integration
tests in a completely different location from all other options.
2016-06-14 14:54:16 +02:00
Martin Afanasjew
92f51abf59 tests: avoid compat code in --no-compat mode (#347)
Simply drop because the `require`s are not actually used by the tests
and no file from `compat/` should be loaded unconditionally. (This can
otherwise lead to incorrect results for `brew tests --no-compat`.)
2016-06-14 14:53:43 +02:00
Dominyk Tiller
01b514f57a
tests: add test bottle for Sierra
Fixes:

```
  1) Error:
FormularyFactoryTest#test_factory_from_bottle:
Errno::ENOENT: No such file or directory - /usr/local/Library/Homebrew/test/bottles/testball_bottle-0.1.sierra.bottle.tar.gz
    /usr/local/Library/Homebrew/formulary.rb:98:in `realpath'
    /usr/local/Library/Homebrew/formulary.rb:98:in `realpath'
    /usr/local/Library/Homebrew/formulary.rb:98:in `initialize'
    /usr/local/Library/Homebrew/formulary.rb:274:in `new'
    /usr/local/Library/Homebrew/formulary.rb:274:in `loader_for'
    /usr/local/Library/Homebrew/formulary.rb:215:in `factory'
    /usr/local/Library/Homebrew/test/test_formulary.rb:79:in `test_factory_from_bottle'
```

Closes #358.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-06-14 02:58:15 +01:00
Andrea Kao
3f7fffe17d tests: extend cmd/log integration test (#333) 2016-06-12 13:50:34 +01:00
Xu Cheng
8d64b6a02d introduce global lock directory (#337)
Since #292, HOMEBREW_CACHE was moved to a per-user directory. This makes
it unsuitable to store global lock files on multiple users environment.

Therefore, introducing a global lock directory `/Library/Lock.d` to
store lock files from formula lockers as well as `brew update`.
2016-06-08 17:29:03 +08:00
Andrea Kao
5ac6eb434e tests: extend cmd/desc integration test (#314) 2016-06-03 13:10:38 +01:00
Martin Afanasjew
d2cdbcbb18 tests: add missing require
Amends e4d0187120e61bc80d31ebecc3b38f0740b20bb5. The `require` was
accidentally omitted causing the tests to fail very sporadically (or
always, when invoked as `brew tests --only=integration_cmds`).
2016-06-02 09:36:51 +02:00
Andrea Kao
e4d0187120 tests: extend cmd/home integration test (#305) 2016-06-02 01:26:32 +02:00
Mike McQuaid
f12932cf31 test_integration_cmds: fix when not a developer. 2016-05-30 21:44:59 +01:00
Mike McQuaid
0551471536 tests: no --only minimum coverage requirement. (#299)
This will almost certainly fail every time so let's disable this error.
2016-05-30 10:49:03 +01:00
Martin Afanasjew
78f8c60343 tests: fix external command test and code style (#281)
The check that `t4` is not an external command would always succeed, but
not because the file wasn't executable, but because it wasn't even found
due to the missing `brew-` prefix.

Also change the valid but atypical file mode from 0744 to 0755 and apply
minor code style fixes.
2016-05-27 23:12:26 +02:00
Mike McQuaid
375efe0945 Remove LLVM-GCC support. (#252)
At this point it's never a good compiler to use so let's just remove it.
2016-05-22 09:40:08 +01:00
Paolo G. Giarrusso
2f20a42292 Synchronize counts for link and unlink (#242)
Closes #239.
2016-05-15 12:07:58 +01:00
Mike McQuaid
0158fc6da8 test_integration_cmds: print output on failure. (#213)
Makes it easy to debug what’s gone wrong.
2016-05-08 17:12:31 +01:00
Mike McQuaid
61614d3529 test_integration_cmds: add cleanup test. 2016-05-08 17:11:57 +01:00
Mike McQuaid
e316cc9296 Make development tools code cross-platform. 2016-05-08 16:51:22 +01:00
Mike McQuaid
931e292bf1 Make bottle code cross-platform. 2016-05-08 16:51:22 +01:00
Score_Under
b5007c48e0 Tty: Avoid truncating if not sensible
This causes truncate to simply return the original string if the
terminal is not very wide, or if the terminal is unsupported.
2016-05-03 15:56:47 +01:00
Martin Afanasjew
02289fce42 Update Homebrew/homebrew references in code
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Martin Afanasjew
8600b9edf1 Update Homebrew/homebrew references in comments
Replace `homebrew` with `brew`, `homebrew-core`, or `legacy-homebrew`
depending on context.
2016-05-02 21:19:09 +02:00
Christian Moritz
bc98fd3788 Language::Node.npm_install_args: add helper method (#37)
* add Language::Node helper module

This adds a language module for Node module based formulas.
It contains the 2 public methods `std_npm_install_args(libexec)` and
`local_npm_install_args`:

* `std_npm_install_args` is intended to be used in formulas for
  standard node modules and returns `npm install` args for a global
  style module installation to libexec.
* `local_npm_install_args` is for formulas, in which the `npm install`
  step is only one of multiple parts of the installation process and
  returns `npm install` args for a default local installation in place.

Both methods have in common, that they are

* making sure that a working copy of npm and node-gyp from node's
  libexec is prepended to the PATH (to not rely of a user managed npm)
* seting the npm cache to HOMEBREW_CACHE/npm, which fixes issues caused
  by overriding $HOME resulting in long install times + high disk usage
  (see https://github.com/Homebrew/brew/pull/37#issuecomment-208840366)

* audit: update npm install check for Language::Node

* cleanup: remove npm_cache too

* doc: add Node-for-Formula-Authors.md
2016-04-27 17:08:44 +01:00
Misty De Meo
f5f41f2079 doctor: remove autotools check 2016-04-21 09:36:30 -07:00
Martin Afanasjew
b53f0c5ada tests: expand help and help-related tests
Closes #114.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-20 13:46:10 +02:00
Martin Afanasjew
d183ff8065 tests: fix Ruby 1.8 syntax warnings
In `Library/Homebrew/test/`:

test_integration_cmds.rb:431: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:502: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:507: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:585: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:709: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:710: warning: (...) interpreted as grouped expression
test_integration_cmds.rb:711: warning: (...) interpreted as grouped expression
2016-04-20 01:42:14 +02:00
Xu Cheng
71b6e0aa18 Tap#install: better TapRemoteMismatchError check
* remote check requires `git` installed.
* Do not perform check if user does not passing remote explicitly.

Fixes #108
2016-04-19 16:29:29 +08:00
Andrew Janke
acc9a7ca85 brew test, install, update-test: add --keep-tmp option
Also enables sandbox for --interactive and --debug use of install
and test, using automatic retention.

Closes #66.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-18 12:23:08 -04:00
Martin Afanasjew
144d86f733 tests: test FormulaClassUnavailableError
Closes #101.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-17 21:16:01 +02:00
Josh Hagins
0fe6acea3a tests: ensure desc prints short name only if there are conflicts
Fixes #70.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-04-16 16:15:08 +02:00
Xu Cheng
548be81b34 tap: various improvements (#77)
* make `read_or_set_private_config` private
* add doc
* add test
2016-04-12 18:51:43 +08:00
Martin Afanasjew
7771f3af81 tests: update prune --verbose test
Closes #15.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-04-06 10:31:54 +02:00
Martin Afanasjew
f2245adaa7 tests: update linkapps/unlinkapps tests 2016-04-06 10:31:54 +02:00
Dominyk Tiller
776a73da7c test_cmd_audit: add plist test 2016-04-05 23:57:53 +01:00
ilovezfs
fad235d8e8 tap: support --full even if installed
Makes `tap` re-runnable and unshallows when requested with `--full`.
Tapping with a different URL raises an exception.

The homebrew/core tap cannot be untapped with `untap` so running
`brew tap --full homebrew/core` is now a built-in way to get a full
clone of this tap without resorting to workarounds.

Closes #17.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-04-05 07:25:27 -07:00
Mike McQuaid
276a797d37 Update documentation after repository split. 2016-04-03 14:03:33 +01:00
Xu Cheng
deea4c82a4 fix brew tests
Fix the `brew tests` problem caused by core/formula separation.
2016-04-02 21:51:36 +08:00
Xu Cheng
91fd357c90 Pathname: improve compute_disk_usage
* Count .DS_Store disk usage but not file count.
* Count symlink's own disk usage instead of ignoring it.
* Count hardlinks disk usage only once.
* Add testcase.

Closes Homebrew/homebrew#50563.

Closes Homebrew/homebrew#50566.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-04-01 16:30:14 +08:00
Xu Cheng
b8a4677de0 --repository: support to show tap path
This can become handy when we separate core code and formulae. For
example, we could use `cd $(brew --repo homebrew/core)` to go to core
tap path.

Closes Homebrew/homebrew#50346.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-24 14:52:13 +08:00
Dominyk Tiller
4f70064d73 test_diagnostic: update expected wording 2016-03-22 18:55:19 +08:00
Xu Cheng
ce7b32cec8 add HOMEBREW_ENV_PATH internal variable
`Library/ENV` like `Library/Homebrew` is part of Homebrew basecode. It
should be able to be accessed during the `brew tests`.

By adding HOMEBREW_ENV_PATH variable, we allow test suit to locate these
codes.
2016-03-21 19:07:38 +08:00
Xu Cheng
28b4923dad fix tests for deprecating SHA1
Closes Homebrew/homebrew#50272.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-20 14:55:58 +08:00
Baptiste Fontaine
236a18debe audit: fix crash when HOMEBREW_NO_GITHUB_API is set
Running brew audit --strict --online on a formula with a GitHub
homepage/url would crash if HOMEBREW_NO_GITHUB_API is set because
GitHub.repository returns `nil` and the audit code assumes it always
returns a hash.

Closes Homebrew/homebrew#50054.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-03-14 19:39:15 +08:00
Mike McQuaid
041c8502c5 Set HOMEBREW_API_TOKEN from Git when available.
As requested in Homebrew/homebrew#46578. Falls back to existing functionality.

Closes Homebrew/homebrew#46578.

Closes Homebrew/homebrew#49846.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 20:52:11 +08:00
Xu Cheng
0cbc285701 test_update_report: simplify test
Closes Homebrew/homebrew#49874.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-08 20:36:19 +08:00
Mike McQuaid
0578ba0f42 install_renamed: handle recursive installs.
Closes Homebrew/homebrew#49845.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-03-08 13:47:29 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
Xu Cheng
9f96e41b40 tap: add methods to get git related information
These methods will be used in `brew --version`, `brew config`
and `brew doctor` after core/formula separation.

Closes Homebrew/homebrew#49796.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-03-06 13:51:06 +08:00
Xu Cheng
eb6f970b90 tap: support --quieter flag
Closes Homebrew/homebrew#49551.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 18:42:36 +08:00
Xu Cheng
73b79de7bc ARGV: switch? should only has one dash
If user inputs argument such as `-with-flag`, we can assume it's a bad flag.

Closes Homebrew/homebrew#49256

Closes Homebrew/homebrew#49550.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 16:50:55 +08:00
Xu Cheng
ba147818cb test_formulary: use CoreFormulaRepository abstraction 2016-02-26 13:33:36 +08:00