diff options
| author | Samuel John | 2013-06-13 15:52:23 +0200 |
|---|---|---|
| committer | Samuel John | 2013-09-05 15:26:57 +0200 |
| commit | fd03aa527d1a4a44f202a9841b6b4e05ee6065b6 (patch) | |
| tree | d92c005f499a500f016647f2f0a8a8001240282d /Library/Formula/libxml2.rb | |
| parent | c54f879fbf53c7742d252c2534868538488a2fa9 (diff) | |
| download | homebrew-fd03aa527d1a4a44f202a9841b6b4e05ee6065b6.tar.bz2 | |
Improve python tests for brew bots
Allow `build.with?` and similar methods to be used during the test
phase. The BuildOptions (`build`) are initialized with the
`Tab.used_options` unless explicitly overwritten on the command line.
So basically `build.with?` works in `def install` and in `test do` as
one would naively expect. (For the test, gramatically it should be
`built.with?` but who cares)
If a formula was installed `--with-python`, now the tests are also
run `--with-python`. This enables us to use the `python do ... end` in
a meaningful manner.
Using `python do ... end` blocks for the tests, because the bot.brew.sh has
system python per default and we need to set the PYTHONPATH for the test.
Potentially to different values for Python 2.x and 3.x.
Diffstat (limited to 'Library/Formula/libxml2.rb')
| -rw-r--r-- | Library/Formula/libxml2.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Library/Formula/libxml2.rb b/Library/Formula/libxml2.rb index ff762f22e..f78d0a1c0 100644 --- a/Library/Formula/libxml2.rb +++ b/Library/Formula/libxml2.rb @@ -75,11 +75,8 @@ class Libxml2 < Formula end test do - if build.with? 'python' + python do system python, '-c', "import libxml2" - else - puts "No tests because built --without-python." - true end end end |
