Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a9b29ce1
Commit
a9b29ce1
authored
Oct 29, 2010
by
Benjamin Peterson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make gdb skip expected
parent
d87fb889
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
Lib/test/regrtest.py
Lib/test/regrtest.py
+3
-0
Lib/test/support.py
Lib/test/support.py
+13
-0
Lib/test/test_gdb.py
Lib/test/test_gdb.py
+3
-11
No files found.
Lib/test/regrtest.py
View file @
a9b29ce1
...
...
@@ -1449,6 +1449,9 @@ class _ExpectedSkips:
if sys.platform != 'sunos5':
self.expected.add('test_nis')
if support.python_is_optimized():
self.expected.add("test_gdb")
self.valid = True
def isvalid(self):
...
...
Lib/test/support.py
View file @
a9b29ce1
...
...
@@ -20,6 +20,9 @@ import re
import
subprocess
import
imp
import
time
import
sysconfig
try
:
import
_thread
except
ImportError
:
...
...
@@ -885,6 +888,16 @@ def gc_collect():
gc
.
collect
()
def
python_is_optimized
():
"""Find if Python was built with optimizations."""
cflags
=
sysconfig
.
get_config_vars
()[
'PY_CFLAGS'
]
final_opt
=
""
for
opt
in
cflags
.
split
():
if
opt
.
startswith
(
'-O'
):
final_opt
=
opt
return
final_opt
and
final_opt
!=
'-O0'
#=======================================================================
# Decorator for running a function in a different locale, correctly resetting
# it afterwards.
...
...
Lib/test/test_gdb.py
View file @
a9b29ce1
...
...
@@ -9,9 +9,8 @@ import subprocess
import
sys
import
unittest
import
locale
import
sysconfig
from
test.support
import
run_unittest
,
findfile
from
test.support
import
run_unittest
,
findfile
,
python_is_optimized
try
:
gdb_version
,
_
=
subprocess
.
Popen
([
"gdb"
,
"--version"
],
...
...
@@ -665,15 +664,8 @@ class PyLocalsTests(DebuggerTests):
r".*\na = 1\nb = 2\nc = 3\n.*"
)
def
test_main
():
cflags
=
sysconfig
.
get_config_vars
()[
'PY_CFLAGS'
]
final_opt
=
""
for
opt
in
cflags
.
split
():
if
opt
.
startswith
(
'-O'
):
final_opt
=
opt
if
final_opt
and
final_opt
!=
'-O0'
:
raise
unittest
.
SkipTest
(
"Python was built with compiler optimizations, "
"tests can't reliably succeed"
)
if
python_is_optimized
():
raise
unittest
.
SkipTest
(
"Python was compiled with optimizations"
)
run_unittest
(
PrettyPrintTests
,
PyListTests
,
StackNavigationTests
,
...
...
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