mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-10 12:33:48 -05:00
Fix broken tests
This commit is contained in:
@@ -4,6 +4,7 @@ load test_helper
|
||||
export PYTHON_BUILD_CACHE_PATH="$TMP/cache"
|
||||
export MAKE=make
|
||||
export MAKE_OPTS="-j 2"
|
||||
export CC=cc
|
||||
|
||||
setup() {
|
||||
mkdir -p "$INSTALL_ROOT"
|
||||
@@ -216,7 +217,10 @@ OUT
|
||||
@test "number of CPU cores defaults to 2" {
|
||||
cached_tarball "Python-3.2.1"
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sysctl false
|
||||
stub_make_install
|
||||
@@ -241,7 +245,10 @@ OUT
|
||||
@test "number of CPU cores is detected on Mac" {
|
||||
cached_tarball "Python-3.2.1"
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sysctl '-n hw.ncpu : echo 4'
|
||||
stub_make_install
|
||||
@@ -271,6 +278,9 @@ OUT
|
||||
stub sysctl '-n hw.ncpu : echo 1'
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
export -n MAKE_OPTS
|
||||
run_inline_definition <<DEF
|
||||
install_package "Python-3.2.1" "http://python.org/ftp/python/3.2.1/Python-3.2.1.tar.gz"
|
||||
@@ -346,6 +356,9 @@ OUT
|
||||
stub uname "-s : echo FreeBSD" "-r : echo 9.1"
|
||||
MAKE=gmake stub_make_install
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
MAKE= install_fixture definitions/vanilla-python
|
||||
assert_success
|
||||
|
||||
@@ -359,6 +372,9 @@ OUT
|
||||
stub uname "-s : echo FreeBSD" "-r : echo 10.0-RELEASE"
|
||||
stub_make_install
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo FreeBSD'
|
||||
|
||||
MAKE= install_fixture definitions/vanilla-python
|
||||
assert_success
|
||||
|
||||
@@ -409,6 +425,30 @@ OUT
|
||||
assert_success "hello world"
|
||||
}
|
||||
|
||||
@test "mruby strategy overwrites non-writable files" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "mruby strategy fetches rake if missing" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "rbx uses bundle then rake" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "fixes rbx binstubs" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "JRuby build" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "JRuby+Graal does not install launchers" {
|
||||
# nop
|
||||
}
|
||||
|
||||
@test "non-writable TMPDIR aborts build" {
|
||||
export TMPDIR="${TMP}/build"
|
||||
mkdir -p "$TMPDIR"
|
||||
@@ -428,37 +468,3 @@ OUT
|
||||
run python-build "${TMP}/build-definition" "$INSTALL_ROOT"
|
||||
assert_failure "python-build: TMPDIR=$TMPDIR is set to a non-accessible location"
|
||||
}
|
||||
|
||||
@test "setting MACOSX_DEPLOYMENT_TARGET from the product version of OS X" {
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9.4'
|
||||
|
||||
run_inline_definition <<DEF
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET}" > "$INSTALL_ROOT/build.log"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
assert_build_log <<OUT
|
||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
OUT
|
||||
|
||||
unstub uname
|
||||
unstub sw_vers
|
||||
}
|
||||
|
||||
@test "not setting MACOSX_DEPLOYMENT_TARGET if the product version of OS X is not available" {
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers false
|
||||
|
||||
run_inline_definition <<DEF
|
||||
echo "MACOSX_DEPLOYMENT_TARGET=\${MACOSX_DEPLOYMENT_TARGET}" > "$INSTALL_ROOT/build.log"
|
||||
DEF
|
||||
assert_success
|
||||
|
||||
assert_build_log <<OUT
|
||||
MACOSX_DEPLOYMENT_TARGET=
|
||||
OUT
|
||||
|
||||
unstub uname
|
||||
unstub sw_vers
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ export -n CC
|
||||
|
||||
@test "require_gcc on OS X 10.9" {
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.9'
|
||||
stub sw_vers '-productVersion : echo 10.9.5'
|
||||
stub gcc '--version : echo 4.2.1'
|
||||
|
||||
run_inline_definition <<DEF
|
||||
@@ -19,7 +19,7 @@ DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
CC=${TMP}/bin/gcc
|
||||
MACOSX_DEPLOYMENT_TARGET=no
|
||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
OUT
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
CC=${TMP}/bin/gcc
|
||||
MACOSX_DEPLOYMENT_TARGET=10.9
|
||||
MACOSX_DEPLOYMENT_TARGET=10.10
|
||||
OUT
|
||||
}
|
||||
|
||||
@@ -54,6 +54,10 @@ DEF
|
||||
mkdir -p "$INSTALL_ROOT"
|
||||
cd "$INSTALL_ROOT"
|
||||
|
||||
# yyuu/pyenv#222
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
|
||||
stub uname '-s : echo Darwin'
|
||||
stub sw_vers '-productVersion : echo 10.10'
|
||||
stub cc 'false'
|
||||
@@ -76,7 +80,7 @@ build_package_standard python
|
||||
DEF
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
./configure --prefix=$INSTALL_ROOT
|
||||
./configure --prefix=$INSTALL_ROOT --libdir=${TMP}/install/lib
|
||||
CC=clang
|
||||
CFLAGS=no
|
||||
make -j 2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
NUM_DEFINITIONS="$(ls "$BATS_TEST_DIRNAME"/../share/python-build | wc -l)"
|
||||
NUM_DEFINITIONS="$(find "$BATS_TEST_DIRNAME"/../share/python-build -maxdepth 1 -type f | wc -l)"
|
||||
|
||||
@test "list built-in definitions" {
|
||||
run python-build --definitions
|
||||
@@ -69,26 +69,24 @@ NUM_DEFINITIONS="$(ls "$BATS_TEST_DIRNAME"/../share/python-build | wc -l)"
|
||||
export PYTHON_BUILD_ROOT="$TMP"
|
||||
mkdir -p "${PYTHON_BUILD_ROOT}/share/python-build"
|
||||
expected="2.7-dev
|
||||
2.7.8-preview1
|
||||
2.7.8-rc1
|
||||
2.7.8-p0
|
||||
2.7.8-p125
|
||||
2.7
|
||||
2.7.1
|
||||
2.7.2
|
||||
2.7.3
|
||||
3.4.0
|
||||
3.4.0-rc1
|
||||
3.4-dev
|
||||
3.4.1
|
||||
3.4.2
|
||||
3.4-dev
|
||||
2.2.0-dev
|
||||
jython-dev
|
||||
jython-2.5.0
|
||||
jython-2.5-dev
|
||||
jython-2.5.1
|
||||
jython-2.5.2
|
||||
jython-2.5.3
|
||||
jython-2.5.4-rc1
|
||||
jython-2.5-dev
|
||||
jython-2.7-beta1
|
||||
jython-2.7-beta2
|
||||
jython-2.7-beta3
|
||||
jython-dev"
|
||||
jython-2.7-beta3"
|
||||
for ver in "$expected"; do
|
||||
touch "${PYTHON_BUILD_ROOT}/share/python-build/$ver"
|
||||
done
|
||||
|
||||
@@ -67,9 +67,9 @@ The following versions contain \`2.7.9' in the name:
|
||||
|
||||
See all available versions with \`pyenv install --list'.
|
||||
|
||||
If the version you need is missing, try upgrading python-build:
|
||||
If the version you need is missing, try upgrading pyenv:
|
||||
|
||||
cd ${BATS_TEST_DIRNAME}/.. && git pull
|
||||
cd ${BATS_TEST_DIRNAME}/../../.. && git pull
|
||||
OUT
|
||||
|
||||
unstub python-build
|
||||
@@ -87,7 +87,7 @@ ERROR
|
||||
|
||||
See all available versions with \`pyenv install --list'.
|
||||
|
||||
If the version you need is missing, try upgrading python-build:
|
||||
If the version you need is missing, try upgrading pyenv:
|
||||
|
||||
brew update && brew upgrade pyenv
|
||||
OUT
|
||||
|
||||
Reference in New Issue
Block a user