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.
ClosesHomebrew/homebrew#48872.
Signed-off-by: Xu Cheng <xucheng@me.com>
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.
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.
ClosesHomebrew/homebrew#48323.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
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.
ClosesHomebrew/homebrew#48280.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
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.
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.
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.
FixesHomebrew/homebrew#48208.
ClosesHomebrew/homebrew#48278.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>