aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/libvirt.rb
diff options
context:
space:
mode:
authorSamuel John2013-06-13 15:52:23 +0200
committerSamuel John2013-09-05 15:26:57 +0200
commitfd03aa527d1a4a44f202a9841b6b4e05ee6065b6 (patch)
treed92c005f499a500f016647f2f0a8a8001240282d /Library/Formula/libvirt.rb
parentc54f879fbf53c7742d252c2534868538488a2fa9 (diff)
downloadhomebrew-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/libvirt.rb')
-rw-r--r--Library/Formula/libvirt.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/Library/Formula/libvirt.rb b/Library/Formula/libvirt.rb
index 6b88d28a2..f47bb0b7e 100644
--- a/Library/Formula/libvirt.rb
+++ b/Library/Formula/libvirt.rb
@@ -63,12 +63,10 @@ class Libvirt < Formula
end
test do
- if build.with? 'python'
- python do
- # Testing to import the mod because that is a .so file where linking
- # can break.
- system python, '-c', "import libvirtmod"
- end
+ python do
+ # Testing to import the mod because that is a .so file where linking
+ # can break.
+ system python, '-c', "import libvirtmod"
end
end
end