1222 Commits

Author SHA1 Message Date
Mike McQuaid
3a127e405e development_tools: add installed? method. (#455) 2016-07-06 11:07:24 +01:00
Vlad Shablinsky
0b2cc5c20d
test_download_strategies: add git tests 2016-07-06 16:19:49 +08:00
Misty De Meo
ca005cb824 doctor: check for beta XQuartz releases
Beta versions of XQuartz have address sanitization enabled, which
breaks some software at runtime, including wine.

Closes Homebrew/homebrew-core#2481.

Closes #459.

Signed-off-by: Misty De Meo <mistydemeo@github.com>
2016-07-06 17:21:05 +10:00
Martin Afanasjew
9e021aa661 test/lib/config: group paths by persistence
Rearrange path constants such that persistent paths (that point into the
Homebrew code base) are in one spot and all other paths (that are being
redirected to a temporary location for the duration of the test run) are
grouped together.

Closes #440.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-07-05 20:09:07 +02:00
Andrew Janke
f518f57bd8 gist-logs: truncate log files to be gist-friendly (#279)
Truncates each log file to about 1 MB. This avoids upload and
download errors with the gists, and respects GitHub's suggested
size limits.
2016-07-05 08:45:17 -04:00
Martin Afanasjew
1b1bf56733 tests: fix leak in '[un]linkapps' integration test (#439)
Prior to the fix, every run of the test suite would leave behind a pair
of empty directories in `$TMPDIR`. (A temporary home directory was
created but only its child `Applications` was wiped when done.)
2016-07-05 14:36:02 +02:00
Mike McQuaid
a1b0ef1300 Remove unnecessary official command tapping. 2016-07-04 18:26:47 +01:00
Mike McQuaid
26dcc9786d test_integration_cmds: loosen cask test. 2016-07-04 17:17:20 +01:00
Mike McQuaid
bf42959609 Revert "Revert "Test officially supported cmd taps. (#390)""
This reverts commit dba1958bd79c1c9d18f215dfc2b806ea62edd1c8.
2016-07-04 17:05:37 +01:00
Martin Afanasjew
dba1958bd7 Revert "Test officially supported cmd taps. (#390)"
This reverts commit 252c701c59227c385ef6178fe99523cca8c843bb.

Taps installed prior to running the test suite are not visible to the
test suite as most Homebrew paths are redefined as to not mess up the
local installation.
2016-07-04 17:41:14 +02:00
Mike McQuaid
252c701c59 Test officially supported cmd taps. (#390)
All of these taps use Homebrew internal APIs (or will shortly) and we
autoinstall them all from `brew $CMD`. We should adjust our CI to ensure
that we never accidentally break these taps when making changes to core
code so that these taps can rely more on this core code rather than
having to e.g. vendor equivalent code that never changes on our end.
2016-07-04 16:08:53 +01:00
Vlad Shablinsky
fbac41d95b test_formula: improve test_migration_needed
Closes #432.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-07-02 00:29:45 +02:00
Tim D. Smith
a2681d196f Tests for Step class
Closes #419.
2016-06-29 21:17:09 -07:00
Tim D. Smith
f04ffb614d Move with_environment to testing_env 2016-06-29 21:16:50 -07:00
Tim D. Smith
8cf11912de Test resolve_test_tap 2016-06-29 09:03:09 -07:00
Vlad Shablinsky
0d3b5f6849
test_formula: add migration_needed test 2016-06-29 21:04:27 +08:00
Vlad Shablinsky
d47df68cbd
test_formula: add outdated_versions tests 2016-06-29 21:04:27 +08:00
William Woodruff
cb3ad215b4 test: Add tests for Keg#mach_o_files link behavior.
Move dylib_path and bundle_path from test_mach to testing_env to
accommodate the new tests.

Closes #400.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-06-29 14:34:08 +02:00
Tim D. Smith
70ceb851a5 Revert "test: Add test for Keg#mach_o_files hardlink behavior."
This reverts commit 62d7079684cdb568600e22531c62888622a71ff1.
2016-06-27 23:25:10 -07:00
William Woodruff
62d7079684 test: Add test for Keg#mach_o_files hardlink behavior.
Move dylib_path and bundle_path from test_mach to testing_env to
accommodate the new test.

Closes #400.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2016-06-27 22:56:28 -07:00
Andrea Kao
8b31167a43 tests: refactor formula file creation (#370) 2016-06-22 13:37:17 +01:00
Andrea Kao
cad85754cf tests: add cmd/search integration test (#356) 2016-06-19 22:20:20 +01:00
msbit
01e8e180a8 ENV: mark gcc-6 as supporting C++11 (#349)
Add SharedEnvExtension#gcc_with_cxx11_support? to centralise the
logic for checking whether a compiler is known to support C++11.

Update logic to accept GCC 4.8 and above (including 6). Thereby also
address oversight in #163 where support for GCC 6 was added without
updating the C++11 compiler whitelist.

Add tests for Superenv#cxx11.

Closes #346.
2016-06-16 14:15:28 +02:00
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