aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/fontforge.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/fontforge.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/fontforge.rb')
-rw-r--r--Library/Formula/fontforge.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/Library/Formula/fontforge.rb b/Library/Formula/fontforge.rb
index bb8d9b7fe..dbe0688fe 100644
--- a/Library/Formula/fontforge.rb
+++ b/Library/Formula/fontforge.rb
@@ -85,12 +85,10 @@ class Fontforge < Formula
system "make install"
end
- def test
+ test do
system "#{bin}/fontforge", "-version"
- if build.with? 'python'
- python do
- system python, "-c", "import fontforge"
- end
+ python do
+ system python, "-c", "import fontforge"
end
end