codequery: make test compatible with sandbox

The test attempted to write to the formula's `share/test/` directory.
Instead, it now symlinks the test data into temporary test directory and
places its intermediate output there.
This commit is contained in:
Martin Afanasjew 2015-12-16 23:08:51 +01:00
parent b6397916ee
commit 43f38193dc

View file

@ -25,9 +25,13 @@ class Codequery < Formula
end
test do
cd share+"test" do
system "#{bin}/cqmakedb", "-s", "./codequery.db", "-c", "./cscope.out", "-t", "./tags", "-p"
assert_match "info_platform", `#{bin}/cqsearch -s ./codequery.db -t 'info_platform'`
end
test_files = (share/"test").children
testpath.install_symlink test_files
system "#{bin}/cqmakedb", "-s", "./codequery.db",
"-c", "./cscope.out",
"-t", "./tags",
"-p"
output = shell_output("#{bin}/cqsearch -s ./codequery.db -t info_platform")
assert_match "info_platform", output
end
end