3482 Commits

Author SHA1 Message Date
Baptiste Fontaine
115e6b49bc tests: monkey-patch exec to get coverage reports
Closes Homebrew/homebrew#48923.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-07 11:52:26 +01:00
Baptiste Fontaine
4ce99fa010 tests: remove unnecessary cd 2016-02-07 11:52:25 +01:00
Xu Cheng
f57950404b more test for dependency_expansion
Closes Homebrew/homebrew#48904.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-07 14:58:05 +08:00
Baptiste Fontaine
268fa841de tests: fix simplecov handling in integration tests
Closes Homebrew/homebrew#48250.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-06 14:20:58 +01:00
Baptiste Fontaine
aec4e0723a tests: track all files 2016-02-06 14:20:57 +01:00
Baptiste Fontaine
abf81f9845 tests: use our patched simplecov, bump coveralls
We must bump coveralls otherwise we get a conflicting dependency: we use
a patched simplecov v0.11.1 but coveralls 0.8.9 needs simplecov 0.10.x.
2016-02-06 14:20:57 +01:00
Baptiste Fontaine
d45467172d tests: enforce min. 40% coverage 2016-02-06 14:20:57 +01:00
Baptiste Fontaine
2cf5ceaa20 tests: don't use Coveralls outside of CI 2016-02-06 14:20:57 +01:00
Xu Cheng
12a452557d make HOMEBREW_BREW_FILE a Pathname object
Currently HOMEBREW_BREW_FILE is a String, while other of HOMEBREW_*
variables are all Pathname. This commit unifies them all as Pathname,
so it will not cause any confusion.

Closes Homebrew/homebrew#48872.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-06 02:52:48 +08:00
ilovezfs
fb9818ae8c HOMEBREW_BREW_FILE was unset for the tests
This fixes a regression introduced by 3f6a355, which caused
HOMEBREW_BREW_FILE to be unset while running the tests.

Patch provided by Xu Cheng.
2016-02-05 21:52:11 +08:00
ilovezfs
37e423ebb2 os/mac/hardware: add Skylake CPU.
Closes Homebrew/homebrew#48781.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-03 21:10:01 +00:00
ilovezfs
051cd36046 test_integration_cmds: fix warning.
Closes Homebrew/homebrew#48772.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2016-02-03 21:09:12 +00:00
Baptiste Fontaine
bdf0e0ef4d tests: remove the problematic test-bot test
It makes Travis checks fail on the master.
2016-02-03 18:11:29 +01:00
Baptiste Fontaine
299419a881 tests: more integration tests
Closes Homebrew/homebrew#48785.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-03 16:28:28 +01:00
Baptiste Fontaine
6cccc2d0fe tests: remove unnecessary code 2016-02-03 16:28:28 +01:00
Baptiste Fontaine
abf75cd08f tests: add audit regression test for Homebrew/homebrew#48744
Closes Homebrew/homebrew#48748.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-02-03 14:04:31 +01:00
ilovezfs
cc3d041c26 DSL method "apply" to specify patch files
The "apply" DSL method can be called from patch-do blocks to specify
the paths within an archive of the desired patch files, which will be
applied in the order in which they were supplied to the "apply" calls.
If "apply" isn't used, raise an error whenever the extracted directory
doesn't contain exactly one file.

The "apply" method can be called zero or more times within a patch-do
block with the following syntaxes supported:

    apply "single_apply"
    apply "multiple_apply_1", "multiple_apply_2"
    apply [array_of_apply]

If apply must be used, a single call using the second syntax above is
usually best practice. Each apply leaf should be the relative path to a
specific patch file in the extracted directory.

For example, if extracting this-v123-patches.tar.gz gives you

    this-123
    this-123/.DS_Store
    this-123/LICENSE.txt
    this-123/patches
    this-123/patches/A.diff
    this-123/patches/B.diff
    this-123/patches/C.diff
    this-123/README.txt

and you want to apply only B.diff and C.diff, then you need to use
"patches/B.diff" and "patches/C.diff" for the lowest-level apply leaves.

The code was provided by Xu Cheng. Any mistakes are mine.
2016-02-01 18:37:36 +00:00
Baptiste Fontaine
a173196e32 tests: more integration tests
Closes Homebrew/homebrew#48674.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-31 16:03:36 +01:00
Dominyk Tiller
c6e0c9538f test_cmd_audit: add resource placement test 2016-01-31 00:39:29 +00:00
Baptiste Fontaine
86eb44c96c tests: more integration tests
Closes Homebrew/homebrew#48635.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-31 00:46:35 +01:00
Baptiste Fontaine
47aa71e633 tests: don't try to rm an unexisting file
This line is necessary if the test fails. If it passes the file won't
exist anymore and shouldn't be removed.
2016-01-27 23:03:44 +01:00
Baptiste Fontaine
c25e11563c tests: fix a file leak 2016-01-27 22:38:24 +01:00
Martin Afanasjew
99fd172ea8 tests: validate developer bash commands
Also change the logic a bit to iterate over the individual files per
directory, as having a directory without bash commands will otherwise
pass a literal `*.sh` to `bash -n`, causing it to fail.

Closes Homebrew/homebrew#48323.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-26 16:26:08 +01:00
Baptiste Fontaine
bb588df058 tests: add pkgshare audit tests
Closes Homebrew/homebrew#48435.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-25 17:19:51 +01:00
Baptiste Fontaine
d0998a4907 testing_env: needs_compat utility added
Closes Homebrew/homebrew#48302.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-25 01:26:24 +01:00
Baptiste Fontaine
7b4c43e512 tests: cmd/audit tests added 2016-01-25 01:26:24 +01:00
Martin Afanasjew
89f97295b8 tests: speed up integration test runs
While running a command from the integration tests, invoke `.result` to
trigger a save of the result set, but don't call `.format!` to avoid
(re)generating the HTML output with every run. The final output will
still be written once the main unit test run completes.

This significantly speeds up the integration tests, that take about 1/3
less time to complete when not generating the intermediate output.

Closes Homebrew/homebrew#48280.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-21 05:42:23 +01:00
Martin Afanasjew
274640c97a tests: use unique identifiers w/ integration tests
Commands executed during integration testing are executed in a separate
process and thus generate a new result set for each command. To avoid
that these results override each other, they need to have a unique
`command_name`. Derive this name from the test class/name and the index
of the command inside that test, resulting in identifiers like
`IntegrationCommandTests#test_prefix.1 brew --prefix`.

Also replaces `TEST_TMPDIR` in the arguments with `"@TMPDIR@"` to get a
cleaner command identifier that is independent of the temporary
directory that changes with every run.
2016-01-21 05:42:23 +01:00
Martin Afanasjew
a12c5816aa tests: remove useless filter for coverage tests
The filter for `vendor/bundle/` is useless because this directory is
located in `Homebrew/test/` and that one is already filtered. Moreover,
SimpleCov already loads the `bundler_filter` profile (that installs
basically the same filter) in its default configuration.
2016-01-21 05:42:06 +01:00
Baptiste Fontaine
5775d3b326 command: support .sh commands
Closes Homebrew/homebrew#48192.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-20 22:27:13 +01:00
Baptiste Fontaine
c1e673e19a commands: support .sh commands 2016-01-20 22:27:13 +01:00
Alex Dunn
b8547eab2c update test for Homebrew/homebrew-emacs#158
Closes Homebrew/homebrew#48131.

Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
2016-01-20 11:42:36 -08:00
Alex Dunn
0cde5dd060 test: add metafiles to testball 2016-01-20 11:42:36 -08:00
Baptiste Fontaine
da500eec6a tests: ExternalPatch test added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
343f431c46 tests: exceptions tests added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
4ba4812d1d tests: tap-readme integration test added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
36c734b392 tests: cmd/edit & cmd/info tests added 2016-01-20 20:15:34 +01:00
Baptiste Fontaine
861910b85f sh: flush stdout before executing the shell
Closes Homebrew/homebrew#48268.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-01-20 11:37:42 +01:00
Martin Afanasjew
026363e1ed diagnostic: fix autoconf check
Xcode can only provide autotools if it is installed, thus check that
first. Skipping this check will try to compare a `nil` Xcode version to
4.3, the first version of Xcode to not provide autotools.

Fixes Homebrew/homebrew#48208.

Closes Homebrew/homebrew#48278.

Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
2016-01-20 10:23:21 +01:00
Mike McQuaid
5b7dd99e99 Revert "Revert "dependency: don't recurse infinitely.""
This reverts commit fa43883dd1cd82f234b79c4a322339f03b9c098d.

Closes Homebrew/homebrew#48187.
2016-01-18 08:59:52 +00:00
Misty De Meo
066dd63a87 test_edit: HOMEBREW_EDITOR takes precedence over EDITOR 2016-01-17 13:07:46 -08:00
Mike McQuaid
04a9b0022d test_bash: tests to assert Bash syntax is valid.
Closes Homebrew/homebrew#47380.
2016-01-17 19:48:02 +00:00
Mike McQuaid
99234f0256 Add new update-bash command for testing.
This will become the default updater at a later point in the future.
2016-01-17 19:48:02 +00:00
Baptiste Fontaine
42a4f44c0e tests: bump the min. coverage to 60 2016-01-16 20:25:57 +01:00
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