#!/usr/bin/env bash

set -euxo pipefail

# Building Ruby with YJIT requires rustc, so this test ensures the Rust
# toolchain functions as expected.

ruby-build $(cat debian/tests/latest-version) "$AUTOPKGTEST_TMP" -- --with-yjit
RUBY_YJIT_ENABLE=1 "$AUTOPKGTEST_TMP"/bin/ruby --version | tee "$AUTOPKGTEST_ARTIFACTS"/ruby-yjit-version.txt | grep '+YJIT'
