aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb2
-rw-r--r--Library/Homebrew/test/audit_test.rb34
2 files changed, 35 insertions, 1 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 134965355..35d590b69 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -924,7 +924,7 @@ class FormulaAuditor
end
end
- if text =~ /xcodebuild[ (]["'*]/ && !text.include?("SYMROOT=")
+ if text =~ /xcodebuild[ (]*["'*]*/ && !text.include?("SYMROOT=")
problem 'xcodebuild should be passed an explicit "SYMROOT"'
end
diff --git a/Library/Homebrew/test/audit_test.rb b/Library/Homebrew/test/audit_test.rb
index 1d93c31e0..f4b7cae4a 100644
--- a/Library/Homebrew/test/audit_test.rb
+++ b/Library/Homebrew/test/audit_test.rb
@@ -465,4 +465,38 @@ class FormulaAuditorTests < Homebrew::TestCase
end
end
end
+
+ def test_audit_xcodebuild_suggests_symroot
+ fa = formula_auditor "foo", <<-EOS.undent
+ class Foo < Formula
+ url "http://example.com/foo-1.0.tgz"
+ homepage "http://example.com"
+
+ def install
+ xcodebuild "-project", "meow.xcodeproject"
+ end
+ end
+ EOS
+
+ fa.audit_text
+
+ assert_match 'xcodebuild should be passed an explicit "SYMROOT"', fa.problems.first
+ end
+
+ def test_audit_bare_xcodebuild_suggests_symroot_also
+ fa = formula_auditor "foo", <<-EOS.undent
+ class Foo < Formula
+ url "http://example.com/foo-1.0.tgz"
+ homepage "http://example.com"
+
+ def install
+ xcodebuild
+ end
+ end
+ EOS
+
+ fa.audit_text
+
+ assert_match 'xcodebuild should be passed an explicit "SYMROOT"', fa.problems.first
+ end
end