Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
Pyston
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
Boxiang Sun
Pyston
Commits
3a41df7f
Commit
3a41df7f
authored
Sep 10, 2016
by
Kevin Modzelewski
Committed by
GitHub
Sep 10, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1340 from kmod/cpython_tests
These cpython tests are working now
parents
6681b73e
7747b4b2
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
32 additions
and
19 deletions
+32
-19
from_cpython/Lib/test/test_bz2.py
from_cpython/Lib/test/test_bz2.py
+0
-1
from_cpython/Lib/test/test_copy.py
from_cpython/Lib/test/test_copy.py
+0
-1
from_cpython/Lib/test/test_richcmp.py
from_cpython/Lib/test/test_richcmp.py
+0
-1
from_cpython/Lib/test/test_sysconfig.py
from_cpython/Lib/test/test_sysconfig.py
+0
-1
from_cpython/Lib/test/test_unittest.py
from_cpython/Lib/test/test_unittest.py
+0
-1
from_cpython/Lib/test/test_wait3.py
from_cpython/Lib/test/test_wait3.py
+0
-1
from_cpython/Lib/test/test_wait4.py
from_cpython/Lib/test/test_wait4.py
+0
-1
from_cpython/Modules/bz2module.c
from_cpython/Modules/bz2module.c
+3
-0
from_cpython/Modules/posixmodule.c
from_cpython/Modules/posixmodule.c
+2
-0
src/codegen/irgen/refcounts.cpp
src/codegen/irgen/refcounts.cpp
+2
-2
src/core/types.h
src/core/types.h
+16
-0
src/runtime/builtin_modules/thread.cpp
src/runtime/builtin_modules/thread.cpp
+2
-0
src/runtime/capi.cpp
src/runtime/capi.cpp
+1
-1
src/runtime/objmodel.cpp
src/runtime/objmodel.cpp
+3
-0
src/runtime/types.h
src/runtime/types.h
+1
-1
test/CPYTHON_TEST_NOTES.md
test/CPYTHON_TEST_NOTES.md
+1
-8
test/cpython/warning_tests.py
test/cpython/warning_tests.py
+1
-0
No files found.
from_cpython/Lib/test/test_bz2.py
View file @
3a41df7f
# expected: fail
from
test
import
test_support
from
test
import
test_support
from
test.test_support
import
TESTFN
,
_4G
,
bigmemtest
,
import_module
,
findfile
from
test.test_support
import
TESTFN
,
_4G
,
bigmemtest
,
import_module
,
findfile
...
...
from_cpython/Lib/test/test_copy.py
View file @
3a41df7f
# expected: fail
"""Unit tests for the copy module."""
"""Unit tests for the copy module."""
import
copy
import
copy
...
...
from_cpython/Lib/test/test_richcmp.py
View file @
3a41df7f
# expected: fail
# Tests for rich comparisons
# Tests for rich comparisons
import
unittest
import
unittest
...
...
from_cpython/Lib/test/test_sysconfig.py
View file @
3a41df7f
# expected: fail
"""Tests for sysconfig."""
"""Tests for sysconfig."""
import
unittest
import
unittest
...
...
from_cpython/Lib/test/test_unittest.py
View file @
3a41df7f
# expected: fail
import
unittest.test
import
unittest.test
from
test
import
test_support
from
test
import
test_support
...
...
from_cpython/Lib/test/test_wait3.py
View file @
3a41df7f
# expected: fail
"""This test checks for correct wait3() behavior.
"""This test checks for correct wait3() behavior.
"""
"""
...
...
from_cpython/Lib/test/test_wait4.py
View file @
3a41df7f
# expected: fail
"""This test checks for correct wait4() behavior.
"""This test checks for correct wait4() behavior.
"""
"""
...
...
from_cpython/Modules/bz2module.c
View file @
3a41df7f
...
@@ -1420,6 +1420,9 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
...
@@ -1420,6 +1420,9 @@ BZ2File_init(BZ2FileObject *self, PyObject *args, PyObject *kwargs)
mode
=
(
mode_char
==
'r'
)
?
"rb"
:
"wb"
;
mode
=
(
mode_char
==
'r'
)
?
"rb"
:
"wb"
;
// Pyston change: this prevents leaking refs in the test_bz2.py test
Py_CLEAR
(
self
->
file
);
self
->
file
=
PyObject_CallFunction
((
PyObject
*
)
&
PyFile_Type
,
"(Osi)"
,
self
->
file
=
PyObject_CallFunction
((
PyObject
*
)
&
PyFile_Type
,
"(Osi)"
,
name
,
mode
,
buffering
);
name
,
mode
,
buffering
);
if
(
self
->
file
==
NULL
)
if
(
self
->
file
==
NULL
)
...
...
from_cpython/Modules/posixmodule.c
View file @
3a41df7f
...
@@ -6109,6 +6109,8 @@ wait_helper(pid_t pid, int status, struct rusage *ru)
...
@@ -6109,6 +6109,8 @@ wait_helper(pid_t pid, int status, struct rusage *ru)
Py_DECREF
(
m
);
Py_DECREF
(
m
);
if
(
struct_rusage
==
NULL
)
if
(
struct_rusage
==
NULL
)
return
NULL
;
return
NULL
;
// Pyston addition:
PyGC_RegisterStaticConstant
(
struct_rusage
);
}
}
/* XXX(nnorwitz): Copied (w/mods) from resource.c, there should be only one. */
/* XXX(nnorwitz): Copied (w/mods) from resource.c, there should be only one. */
...
...
src/codegen/irgen/refcounts.cpp
View file @
3a41df7f
...
@@ -100,7 +100,7 @@ bool RefcountTracker::isNullable(llvm::Value* v) {
...
@@ -100,7 +100,7 @@ bool RefcountTracker::isNullable(llvm::Value* v) {
}
}
void
RefcountTracker
::
refConsumed
(
llvm
::
Value
*
v
,
llvm
::
Instruction
*
inst
)
{
void
RefcountTracker
::
refConsumed
(
llvm
::
Value
*
v
,
llvm
::
Instruction
*
inst
)
{
if
(
llvm
::
isa
<
UndefValue
>
(
v
))
if
(
llvm
::
isa
<
UndefValue
>
(
v
)
||
llvm
::
isa
<
ConstantPointerNull
>
(
v
)
)
return
;
return
;
assert
(
this
->
vars
[
v
].
reftype
!=
RefType
::
UNKNOWN
);
assert
(
this
->
vars
[
v
].
reftype
!=
RefType
::
UNKNOWN
);
...
@@ -109,7 +109,7 @@ void RefcountTracker::refConsumed(llvm::Value* v, llvm::Instruction* inst) {
...
@@ -109,7 +109,7 @@ void RefcountTracker::refConsumed(llvm::Value* v, llvm::Instruction* inst) {
}
}
void
RefcountTracker
::
refUsed
(
llvm
::
Value
*
v
,
llvm
::
Instruction
*
inst
)
{
void
RefcountTracker
::
refUsed
(
llvm
::
Value
*
v
,
llvm
::
Instruction
*
inst
)
{
if
(
llvm
::
isa
<
UndefValue
>
(
v
))
if
(
llvm
::
isa
<
UndefValue
>
(
v
)
||
llvm
::
isa
<
ConstantPointerNull
>
(
v
)
)
return
;
return
;
assert
(
this
->
vars
[
v
].
reftype
!=
RefType
::
UNKNOWN
);
assert
(
this
->
vars
[
v
].
reftype
!=
RefType
::
UNKNOWN
);
...
...
src/core/types.h
View file @
3a41df7f
...
@@ -1116,6 +1116,22 @@ public:
...
@@ -1116,6 +1116,22 @@ public:
operator
FILE
*
()
const
{
return
file
;
}
operator
FILE
*
()
const
{
return
file
;
}
};
};
void
throwCAPIException
();
// A C++-style RAII way of doing Py_EnterRecursiveCall + Py_LeaveRecursiveCall
class
_RecursiveBlockHelper
{
public:
~
_RecursiveBlockHelper
()
{
Py_LeaveRecursiveCall
();
}
};
#define RECURSIVE_BLOCK(S, reason) \
_RecursiveBlockHelper CAT(_recursive_helper, __LINE__); \
if (Py_EnterRecursiveCall(reason)) { \
if (S == CAPI) \
return NULL; \
else \
throwCAPIException(); \
}
// similar to Java's Array.binarySearch:
// similar to Java's Array.binarySearch:
// return values are either:
// return values are either:
// >= 0 : the index where a given item was found
// >= 0 : the index where a given item was found
...
...
src/runtime/builtin_modules/thread.cpp
View file @
3a41df7f
...
@@ -220,6 +220,8 @@ void setupThread() {
...
@@ -220,6 +220,8 @@ void setupThread() {
"start_new_thread"
,
"start_new_thread"
,
new
BoxedBuiltinFunctionOrMethod
(
new
BoxedBuiltinFunctionOrMethod
(
BoxedCode
::
create
((
void
*
)
startNewThread
,
BOXED_INT
,
3
,
false
,
false
,
"start_new_thread"
),
{
NULL
}));
BoxedCode
::
create
((
void
*
)
startNewThread
,
BOXED_INT
,
3
,
false
,
false
,
"start_new_thread"
),
{
NULL
}));
thread_module
->
giveAttrBorrowed
(
"start_new"
,
thread_module
->
getattr
(
getStaticString
(
"start_new_thread"
)));
thread_module
->
giveAttr
(
"allocate_lock"
,
new
BoxedBuiltinFunctionOrMethod
(
thread_module
->
giveAttr
(
"allocate_lock"
,
new
BoxedBuiltinFunctionOrMethod
(
BoxedCode
::
create
((
void
*
)
allocateLock
,
UNKNOWN
,
0
,
"allocate_lock"
)));
BoxedCode
::
create
((
void
*
)
allocateLock
,
UNKNOWN
,
0
,
"allocate_lock"
)));
thread_module
->
giveAttr
(
thread_module
->
giveAttr
(
...
...
src/runtime/capi.cpp
View file @
3a41df7f
...
@@ -539,7 +539,7 @@ extern "C" int Py_FlushLine(void) noexcept {
...
@@ -539,7 +539,7 @@ extern "C" int Py_FlushLine(void) noexcept {
return
PyFile_WriteString
(
"
\n
"
,
f
);
return
PyFile_WriteString
(
"
\n
"
,
f
);
}
}
void
setCAPIException
(
STOLEN
(
const
ExcInfo
&
)
e
)
{
void
setCAPIException
(
STOLEN
(
const
ExcInfo
&
)
e
)
noexcept
{
PyErr_Restore
(
e
.
type
,
e
.
value
,
e
.
traceback
);
PyErr_Restore
(
e
.
type
,
e
.
value
,
e
.
traceback
);
}
}
...
...
src/runtime/objmodel.cpp
View file @
3a41df7f
...
@@ -4747,6 +4747,9 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
...
@@ -4747,6 +4747,9 @@ Box* callFunc(BoxedFunctionBase* func, CallRewriteArgs* rewrite_args, ArgPassSpe
template
<
ExceptionStyle
S
>
template
<
ExceptionStyle
S
>
static
Box
*
callChosenCF
(
CompiledFunction
*
chosen_cf
,
BoxedClosure
*
closure
,
BoxedGenerator
*
generator
,
Box
*
globals
,
static
Box
*
callChosenCF
(
CompiledFunction
*
chosen_cf
,
BoxedClosure
*
closure
,
BoxedGenerator
*
generator
,
Box
*
globals
,
Box
*
oarg1
,
Box
*
oarg2
,
Box
*
oarg3
,
Box
**
oargs
)
noexcept
(
S
==
CAPI
)
{
Box
*
oarg1
,
Box
*
oarg2
,
Box
*
oarg3
,
Box
**
oargs
)
noexcept
(
S
==
CAPI
)
{
// TODO: this should be done in the rewrite as well
RECURSIVE_BLOCK
(
S
,
" in function call"
);
if
(
S
!=
chosen_cf
->
exception_style
)
{
if
(
S
!=
chosen_cf
->
exception_style
)
{
if
(
S
==
CAPI
)
{
if
(
S
==
CAPI
)
{
try
{
try
{
...
...
src/runtime/types.h
View file @
3a41df7f
...
@@ -169,7 +169,7 @@ void checkAndThrowCAPIException();
...
@@ -169,7 +169,7 @@ void checkAndThrowCAPIException();
void
throwCAPIException
()
__attribute__
((
noreturn
));
void
throwCAPIException
()
__attribute__
((
noreturn
));
void
ensureCAPIExceptionSet
();
void
ensureCAPIExceptionSet
();
struct
ExcInfo
;
struct
ExcInfo
;
void
setCAPIException
(
STOLEN
(
const
ExcInfo
&
)
e
);
void
setCAPIException
(
STOLEN
(
const
ExcInfo
&
)
e
)
noexcept
;
// Finalizer-related
// Finalizer-related
void
dealloc_null
(
Box
*
box
);
void
dealloc_null
(
Box
*
box
);
...
...
test/CPYTHON_TEST_NOTES.md
View file @
3a41df7f
...
@@ -27,7 +27,6 @@ test_bsddb185 [unknown]
...
@@ -27,7 +27,6 @@ test_bsddb185 [unknown]
test_bsddb3 [unknown]
test_bsddb3 [unknown]
test_bsddb [unknown]
test_bsddb [unknown]
test_builtin execfile scoping issue
test_builtin execfile scoping issue
test_bz2 leaks
test_capi [unknown]
test_capi [unknown]
test_cd [unknown]
test_cd [unknown]
test_cfgparser works when run from inside the from_cpython dir
test_cfgparser works when run from inside the from_cpython dir
...
@@ -54,7 +53,6 @@ test_coercion 1**1L, divmod(1, 1L); some unknown bug
...
@@ -54,7 +53,6 @@ test_coercion 1**1L, divmod(1, 1L); some unknown bug
test_compileall [unknown]
test_compileall [unknown]
test_compiler [unknown]
test_compiler [unknown]
test_compile [unknown]
test_compile [unknown]
test_copy Please debug this test in VM.
test_cprofile [unknown]
test_cprofile [unknown]
test_crypt [unknown]
test_crypt [unknown]
test_ctypes [unknown]
test_ctypes [unknown]
...
@@ -136,7 +134,6 @@ test_pydoc [unknown]
...
@@ -136,7 +134,6 @@ test_pydoc [unknown]
test_random long("invalid number")
test_random long("invalid number")
test_repr complex.__hash__; some unknown issues
test_repr complex.__hash__; some unknown issues
test_resource fails on travis-ci: setrlimit RLIMIT_CPU not allowed to raise maximum limit
test_resource fails on travis-ci: setrlimit RLIMIT_CPU not allowed to raise maximum limit
test_richcmp PyObject_Not
test_runpy [unknown]
test_runpy [unknown]
test_scope eval of code object from existing function (not currently supported)
test_scope eval of code object from existing function (not currently supported)
test_scriptpackages [unknown]
test_scriptpackages [unknown]
...
@@ -152,7 +149,6 @@ test_sundry [unknown]
...
@@ -152,7 +149,6 @@ test_sundry [unknown]
test_support [unknown]
test_support [unknown]
test_symtable [unknown]
test_symtable [unknown]
test_syntax [unknown]
test_syntax [unknown]
test_sysconfig [unknown]
test_sys_setprofile [unknown]
test_sys_setprofile [unknown]
test_sys_settrace [unknown]
test_sys_settrace [unknown]
test_sys [unknown]
test_sys [unknown]
...
@@ -173,13 +169,10 @@ test_ttk_textonly [unknown]
...
@@ -173,13 +169,10 @@ test_ttk_textonly [unknown]
test_types PyErr_WarnEx
test_types PyErr_WarnEx
test_undocumented_details function.func_closure
test_undocumented_details function.func_closure
test_unicode argument passing issue?
test_unicode argument passing issue?
test_unittest leaks
test_userdict segfault: repr of recursive dict?
test_userdict segfault: repr of recursive dict?
test_userlist slice(1L, 1L)
test_userlist slice(1L, 1L)
test_userstring float(1L); hangs in test_replace
test_userstring float(1L); hangs in test_replace
test_wait3 [unknown]
test_warnings Among other things, we don't support the -W flag
test_wait4 [unknown]
test_warnings [unknown]
test_weakref weird function-picking bug (something around float.__add__), plase also fix the weakref issue in test_abc
test_weakref weird function-picking bug (something around float.__add__), plase also fix the weakref issue in test_abc
test_winreg [unknown]
test_winreg [unknown]
test_winsound [unknown]
test_winsound [unknown]
...
...
test/cpython/warning_tests.py
0 → 120000
View file @
3a41df7f
..
/
..
/
from_cpython
/
Lib
/
test
/
warning_tests
.
py
\ No newline at end of file
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