aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorXu Cheng2015-01-08 13:31:29 +0800
committerMike McQuaid2015-01-08 10:23:45 +0000
commit54a45e66eb9bd62a81657f95a2fd7b21a9e01a12 (patch)
treeac14e89527e00d47dea33a37e94051ecde5a8634 /Library/Formula
parent58c12c95ad63dd7b12cc5e729d2acd7cfc3738d0 (diff)
downloadhomebrew-54a45e66eb9bd62a81657f95a2fd7b21a9e01a12.tar.bz2
cscope: add test
Closes #35650.
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/cscope.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/Library/Formula/cscope.rb b/Library/Formula/cscope.rb
index cf58956f4..653da980d 100644
--- a/Library/Formula/cscope.rb
+++ b/Library/Formula/cscope.rb
@@ -11,6 +11,27 @@ class Cscope < Formula
"--mandir=#{man}"
system "make", "install"
end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <stdio.h>
+ #include <stdlib.h>
+
+ void func()
+ {
+ printf("Hello World!");
+ }
+
+ int main()
+ {
+ func();
+ return 0;
+ }
+ EOS
+ (testpath/"cscope.files").write ("./test.c\n")
+ system "#{bin}/cscope", "-b", "-k"
+ assert_match /test\.c.*func/, shell_output("#{bin}/cscope -L1func")
+ end
end
__END__