1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-17 07:43:46 -05:00

Merge pull request #528 from sstephenson/dylib

Speed up rbenv by dynamically loading compiled command
This commit is contained in:
Mislav Marohnić
2014-10-15 18:19:54 +02:00
13 changed files with 749 additions and 31 deletions

View File

@@ -21,7 +21,7 @@ load test_helper
root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run rbenv-init - bash
assert_success
assert_line "source '${root}/libexec/../completions/rbenv.bash'"
assert_line "source '${root}/test/../libexec/../completions/rbenv.bash'"
}
@test "detect parent shell" {
@@ -35,7 +35,7 @@ load test_helper
root="$(cd $BATS_TEST_DIRNAME/.. && pwd)"
run rbenv-init - fish
assert_success
assert_line ". '${root}/libexec/../completions/rbenv.fish'"
assert_line ". '${root}/test/../libexec/../completions/rbenv.fish'"
}
@test "fish instructions" {

9
test/run Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -e
if [ -n "$RBENV_NATIVE_EXT" ]; then
src/configure
make -C src
fi
exec bats ${CI:+--tap} test

View File

@@ -1,7 +1,15 @@
unset RBENV_VERSION
unset RBENV_DIR
RBENV_TEST_DIR="${BATS_TMPDIR}/rbenv"
if enable -f "${BATS_TEST_DIRNAME}"/../libexec/rbenv-realpath.dylib realpath 2>/dev/null; then
RBENV_TEST_DIR="$(realpath "$BATS_TMPDIR")/rbenv"
else
if [ -n "$RBENV_NATIVE_EXT" ]; then
echo "rbenv: failed to load \`realpath' builtin" >&2
exit 1
fi
RBENV_TEST_DIR="${BATS_TMPDIR}/rbenv"
fi
# guard against executing this block twice due to bats internals
if [ "$RBENV_ROOT" != "${RBENV_TEST_DIR}/root" ]; then