quickjs 2019-07-09 (new formula)

Use make install with prefix

Add more tests

Closes #41955.

Signed-off-by: FX Coudert <fxcoudert@gmail.com>
This commit is contained in:
Dave Nicolson 2019-07-15 00:46:59 +02:00 committed by FX Coudert
parent dd97069b3c
commit 95f40126e4

21
Formula/quickjs.rb Normal file
View file

@ -0,0 +1,21 @@
class Quickjs < Formula
desc "Small and embeddable JavaScript engine"
homepage "https://bellard.org/quickjs/"
url "https://bellard.org/quickjs/quickjs-2019-07-09.tar.xz"
sha256 "350c1cd9dd318ad75e15c9991121c80b85c2ef873716a8900f811554017cd564"
def install
system "make", "install", "prefix=#{prefix}"
end
test do
output = shell_output("#{bin}/qjs -e 'console.log(\"hello\");'").strip
assert_equal "hello", output
path = testpath/"test.js"
path.write "console.log('hello');"
system "#{bin}/qjsc", path
output = shell_output(testpath/"a.out").strip
assert_equal "hello", output
end
end