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
c95ec3d5
Kaydet (Commit)
c95ec3d5
authored
Mar 16, 2011
tarafından
Nick Coghlan
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Exercise crashers to ensure they are still covering known error cases
üst
cfec350e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
0 deletions
+39
-0
README
Lib/test/crashers/README
+4
-0
test_crashers.py
Lib/test/test_crashers.py
+35
-0
No files found.
Lib/test/crashers/README
Dosyayı görüntüle @
c95ec3d5
...
@@ -14,3 +14,7 @@ note if the cause is system or environment dependent and what the variables are.
...
@@ -14,3 +14,7 @@ note if the cause is system or environment dependent and what the variables are.
Once the crash is fixed, the test case should be moved into an appropriate test
Once the crash is fixed, the test case should be moved into an appropriate test
(even if it was originally from the test suite). This ensures the regression
(even if it was originally from the test suite). This ensures the regression
doesn't happen again. And if it does, it should be easier to track down.
doesn't happen again. And if it does, it should be easier to track down.
Also see Lib/test_crashers.py which exercises the crashers in this directory.
In particular, make sure to add any new infinite loop crashers to the black
list so it doesn't try to run them.
Lib/test/test_crashers.py
0 → 100644
Dosyayı görüntüle @
c95ec3d5
# Tests that the crashers in the Lib/test/crashers directory actually
# do crash the interpreter as expected
#
# If a crasher is fixed, it should be moved elsewhere in the test suite to
# ensure it continues to work correctly.
import
unittest
import
glob
import
os.path
import
test.support
from
test.script_helper
import
assert_python_failure
CRASHER_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"crashers"
)
CRASHER_FILES
=
os
.
path
.
join
(
CRASHER_DIR
,
"*.py"
)
infinite_loops
=
[
"infinite_loop_re.py"
,
"nasty_eq_vs_dict.py"
]
class
CrasherTest
(
unittest
.
TestCase
):
@test.support.cpython_only
def
test_crashers_crash
(
self
):
for
fname
in
glob
.
glob
(
CRASHER_FILES
):
if
os
.
path
.
basename
(
fname
)
in
infinite_loops
:
continue
# Some "crashers" only trigger an exception rather than a
# segfault. Consider that an acceptable outcome.
assert_python_failure
(
fname
)
def
test_main
():
test
.
support
.
run_unittest
(
CrasherTest
)
test
.
support
.
reap_children
()
if
__name__
==
"__main__"
:
test_main
()
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