diff options
| author | Mike Naberezny | 2014-02-06 10:41:39 -0800 |
|---|---|---|
| committer | Mike McQuaid | 2014-02-06 19:25:22 +0000 |
| commit | 9bf76302a2fd757f24f89d6adfc7a3aa413c8fb7 (patch) | |
| tree | e49cb1b731ea316f52e8b0708a1b1fde511a0aa7 /Library | |
| parent | f48489133c4f00f957f46c2310364dfffd426a97 (diff) | |
| download | homebrew-9bf76302a2fd757f24f89d6adfc7a3aa413c8fb7.tar.bz2 | |
splint: add test
Closes #26479.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/splint.rb | 17 |
1 files changed, 17 insertions, 0 deletions
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 <stdio.h> + 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 |
