Commit a8a3ebf8 authored by Benoit Daloze's avatar Benoit Daloze
Browse files

Add tests for TruffleRuby

parent ad4a9fef
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -634,6 +634,34 @@ DEF
  assert_success
}

@test "TruffleRuby post-install hook" {
  executable "${RUBY_BUILD_CACHE_PATH}/truffleruby-test/lib/truffle/post_install_hook.sh" <<OUT
echo Running post-install hook
OUT
  cached_tarball "truffleruby-test" bin/truffleruby
  stub opt true

  run_inline_definition <<DEF
install_package "truffleruby-test" "URL" truffleruby
DEF
  assert_success
  assert_output_contains "Running post-install hook"
}

@test "TruffleRuby LLVM missing" {
  executable "${RUBY_BUILD_CACHE_PATH}/truffleruby-test/lib/truffle/post_install_hook.sh" <<OUT
echo Running post-install hook
OUT
  cached_tarball "truffleruby-test" bin/truffleruby
  stub opt false

  run_inline_definition <<DEF
install_package "truffleruby-test" "URL" truffleruby
DEF
  assert_failure
  assert_output_contains "TruffleRuby requires LLVM to be installed to run native extensions."
}

@test "non-writable TMPDIR aborts build" {
  export TMPDIR="${TMP}/build"
  mkdir -p "$TMPDIR"
+3 −1
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ NUM_DEFINITIONS="$(ls "$BATS_TEST_DIRNAME"/../share/ruby-build | wc -l)"
  assert_success
  assert_output_contains "1.9.3-p194"
  assert_output_contains "jruby-1.7.9"
  assert_output_contains "truffleruby-1.0.0-rc2"
  assert [ "${#lines[*]}" -eq "$NUM_DEFINITIONS" ]
}

@@ -90,7 +91,8 @@ jruby-1.7.1
jruby-1.7.9
jruby-1.7.10
jruby-9000-dev
jruby-9000"
jruby-9000
truffleruby-1.0.0-rc2"
  for ver in $expected; do
    touch "${RUBY_BUILD_ROOT}/share/ruby-build/$ver"
  done