Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
c811fb2d
Kaydet (Commit)
c811fb2d
authored
Agu 26, 2011
tarafından
Éric Araujo
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add tests for build_ext --user (backport from 3.2)
üst
04612d60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
test_build_ext.py
Lib/distutils/tests/test_build_ext.py
+36
-0
No files found.
Lib/distutils/tests/test_build_ext.py
Dosyayı görüntüle @
c811fb2d
...
...
@@ -27,6 +27,12 @@ class BuildExtTestCase(support.TempdirManager,
self
.
xx_created
=
False
sys
.
path
.
append
(
self
.
tmp_dir
)
self
.
addCleanup
(
sys
.
path
.
remove
,
self
.
tmp_dir
)
if
sys
.
version
>
"2.6"
:
import
site
self
.
old_user_base
=
site
.
USER_BASE
site
.
USER_BASE
=
self
.
mkdtemp
()
from
distutils.command
import
build_ext
build_ext
.
USER_BASE
=
site
.
USER_BASE
def
tearDown
(
self
):
if
self
.
xx_created
:
...
...
@@ -97,6 +103,36 @@ class BuildExtTestCase(support.TempdirManager,
# make sure we get some library dirs under solaris
self
.
assertTrue
(
len
(
cmd
.
library_dirs
)
>
0
)
def
test_user_site
(
self
):
# site.USER_SITE was introduced in 2.6
if
sys
.
version
<
'2.6'
:
return
import
site
dist
=
Distribution
({
'name'
:
'xx'
})
cmd
=
build_ext
(
dist
)
# making sure the user option is there
options
=
[
name
for
name
,
short
,
label
in
cmd
.
user_options
]
self
.
assertIn
(
'user'
,
options
)
# setting a value
cmd
.
user
=
1
# setting user based lib and include
lib
=
os
.
path
.
join
(
site
.
USER_BASE
,
'lib'
)
incl
=
os
.
path
.
join
(
site
.
USER_BASE
,
'include'
)
os
.
mkdir
(
lib
)
os
.
mkdir
(
incl
)
cmd
.
ensure_finalized
()
# see if include_dirs and library_dirs were set
self
.
assertIn
(
lib
,
cmd
.
library_dirs
)
self
.
assertIn
(
lib
,
cmd
.
rpath
)
self
.
assertIn
(
incl
,
cmd
.
include_dirs
)
def
test_finalize_options
(
self
):
# Make sure Python's include directories (for Python.h, pyconfig.h,
# etc.) are in the include search path.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment