From 9bf76302a2fd757f24f89d6adfc7a3aa413c8fb7 Mon Sep 17 00:00:00 2001 From: Mike Naberezny Date: Thu, 6 Feb 2014 10:41:39 -0800 Subject: splint: add test Closes #26479. Signed-off-by: Mike McQuaid --- Library/Formula/splint.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Library/Formula') diff --git a/Library/Formula/splint.rb b/Library/Formula/splint.rb index fae225a97..45f951067 100644 --- a/Library/Formula/splint.rb +++ b/Library/Formula/splint.rb @@ -19,6 +19,23 @@ class Splint < Formula system "make" system "make install" end + + test do + path = testpath/"test.c" + path.write <<-EOS.undent + #include + int main() + { + char c; + printf("%c", c); + return 0; + } + EOS + + output = `#{bin}/splint #{path} 2>&1` + assert output.include?("5:18: Variable c used before definition") + assert_equal 1, $?.exitstatus + end end -- cgit v1.2.3