vala: better test case
Closes Homebrew/homebrew#29339. Signed-off-by: Adam Vandenberg <flangy@gmail.com>
This commit is contained in:
parent
8b82e219f2
commit
a5e2ebaa6b
1 changed files with 21 additions and 2 deletions
|
@ -6,7 +6,6 @@ class Vala < Formula
|
||||||
url "http://ftp.acc.umu.se/pub/gnome/sources/vala/0.24/vala-0.24.0.tar.xz"
|
url "http://ftp.acc.umu.se/pub/gnome/sources/vala/0.24/vala-0.24.0.tar.xz"
|
||||||
sha1 "33a71a21e12e80cf1f4e0aa3b6a6523ff38e92c8"
|
sha1 "33a71a21e12e80cf1f4e0aa3b6a6523ff38e92c8"
|
||||||
|
|
||||||
|
|
||||||
depends_on "pkg-config" => :build
|
depends_on "pkg-config" => :build
|
||||||
depends_on "gettext"
|
depends_on "gettext"
|
||||||
depends_on "glib"
|
depends_on "glib"
|
||||||
|
@ -19,6 +18,26 @@ class Vala < Formula
|
||||||
end
|
end
|
||||||
|
|
||||||
test do
|
test do
|
||||||
system "#{bin}/valac", "--version"
|
test_string = "Hello Homebrew\n"
|
||||||
|
path = testpath/"hello.vala"
|
||||||
|
path.write <<-EOS
|
||||||
|
void main () {
|
||||||
|
print ("#{test_string}");
|
||||||
|
}
|
||||||
|
EOS
|
||||||
|
valac_args = [# Build with debugging symbols.
|
||||||
|
"-g",
|
||||||
|
# Use Homebrew's default C compiler.
|
||||||
|
"--cc=#{ENV.cc}",
|
||||||
|
# Save generated C source code.
|
||||||
|
"--save-temps",
|
||||||
|
# Vala source code path.
|
||||||
|
"#{path}"]
|
||||||
|
system "#{bin}/valac", *valac_args
|
||||||
|
assert File.exist?(testpath/"hello.c")
|
||||||
|
|
||||||
|
output = `#{testpath}/hello`
|
||||||
|
assert_equal test_string, output
|
||||||
|
assert_equal 0, $?.exitstatus
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue