3 readonly script_dir
="$(dirname "$0")"
5 # Try to find an hhvm binary. Prefer php (if it's hhvm) or hhvm from $PATH. If
6 # neither of those work, look for hhvm in a few common locations, preferring a
7 # released version over a locally-built version for stability.
8 function get_hhvm_bin
{
11 "/usr/local/hphpi/bin/hhvm"
12 "$script_dir/../../buck-out/gen/hphp/hhvm/hhvm"
13 "$script_dir/../hhvm/hhvm"
16 if php
--version |
& grep -qF 'HipHop VM'; then
21 if command -v hhvm
2>/dev
/null
; then
25 for binary
in "${candidates[@]}"; do
26 if [[ -x "$binary" ]]; then
35 if ! hhvm_bin
="$(get_hhvm_bin)"; then
36 echo "Couldn't find hhvm binary to run test/run" 1>&2
40 exec "$hhvm_bin" "$script_dir/run.php" "$@"