Skip to content

Commit 0949c16

Browse files
skirpichevaisk
authored andcommitted
pythongh-111495: add stub files for C API test modules (pythonGH-111586)
This is to reduce merge conflicts (Modules/Setup.stdlib.in) for subsequent pull requests for the issue.
1 parent 856e654 commit 0949c16

File tree

13 files changed

+204
-3
lines changed

13 files changed

+204
-3
lines changed

Modules/Setup.stdlib.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
@MODULE__XXTESTFUZZ_TRUE@_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c
160160
@MODULE__TESTBUFFER_TRUE@_testbuffer _testbuffer.c
161161
@MODULE__TESTINTERNALCAPI_TRUE@_testinternalcapi _testinternalcapi.c _testinternalcapi/test_lock.c _testinternalcapi/pytime.c _testinternalcapi/set.c
162-
@MODULE__TESTCAPI_TRUE@_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/vectorcall_limited.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/unicode.c _testcapi/dict.c _testcapi/set.c _testcapi/getargs.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyatomic.c _testcapi/pyos.c _testcapi/immortal.c _testcapi/heaptype_relative.c _testcapi/gc.c _testcapi/sys.c
162+
@MODULE__TESTCAPI_TRUE@_testcapi _testcapimodule.c _testcapi/vectorcall.c _testcapi/vectorcall_limited.c _testcapi/heaptype.c _testcapi/abstract.c _testcapi/bytearray.c _testcapi/bytes.c _testcapi/unicode.c _testcapi/dict.c _testcapi/set.c _testcapi/list.c _testcapi/tuple.c _testcapi/getargs.c _testcapi/datetime.c _testcapi/docstring.c _testcapi/mem.c _testcapi/watchers.c _testcapi/long.c _testcapi/float.c _testcapi/complex.c _testcapi/numbers.c _testcapi/structmember.c _testcapi/exceptions.c _testcapi/code.c _testcapi/buffer.c _testcapi/pyatomic.c _testcapi/pyos.c _testcapi/file.c _testcapi/codec.c _testcapi/immortal.c _testcapi/heaptype_relative.c _testcapi/gc.c _testcapi/sys.c
163163
@MODULE__TESTCLINIC_TRUE@_testclinic _testclinic.c
164164
@MODULE__TESTCLINIC_LIMITED_TRUE@_testclinic_limited _testclinic_limited.c
165165

Modules/_testcapi/bytearray.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_ByteArray(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0) {
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

Modules/_testcapi/bytes.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_Bytes(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0) {
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

Modules/_testcapi/codec.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_Codec(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0){
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

Modules/_testcapi/complex.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
static PyMethodDef test_methods[] = {
5+
{NULL},
6+
};
7+
8+
int
9+
_PyTestCapi_Init_Complex(PyObject *mod)
10+
{
11+
if (PyModule_AddFunctions(mod, test_methods) < 0) {
12+
return -1;
13+
}
14+
15+
return 0;
16+
}

Modules/_testcapi/file.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_File(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0){
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

Modules/_testcapi/list.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_List(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0){
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

Modules/_testcapi/numbers.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
static PyMethodDef test_methods[] = {
5+
{NULL},
6+
};
7+
8+
int
9+
_PyTestCapi_Init_Numbers(PyObject *mod)
10+
{
11+
if (PyModule_AddFunctions(mod, test_methods) < 0) {
12+
return -1;
13+
}
14+
15+
return 0;
16+
}

Modules/_testcapi/parts.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
int _PyTestCapi_Init_Vectorcall(PyObject *module);
3232
int _PyTestCapi_Init_Heaptype(PyObject *module);
3333
int _PyTestCapi_Init_Abstract(PyObject *module);
34+
int _PyTestCapi_Init_ByteArray(PyObject *module);
35+
int _PyTestCapi_Init_Bytes(PyObject *module);
3436
int _PyTestCapi_Init_Unicode(PyObject *module);
3537
int _PyTestCapi_Init_GetArgs(PyObject *module);
3638
int _PyTestCapi_Init_DateTime(PyObject *module);
@@ -39,17 +41,23 @@ int _PyTestCapi_Init_Mem(PyObject *module);
3941
int _PyTestCapi_Init_Watchers(PyObject *module);
4042
int _PyTestCapi_Init_Long(PyObject *module);
4143
int _PyTestCapi_Init_Float(PyObject *module);
44+
int _PyTestCapi_Init_Complex(PyObject *module);
45+
int _PyTestCapi_Init_Numbers(PyObject *module);
4246
int _PyTestCapi_Init_Dict(PyObject *module);
4347
int _PyTestCapi_Init_Set(PyObject *module);
48+
int _PyTestCapi_Init_List(PyObject *module);
49+
int _PyTestCapi_Init_Tuple(PyObject *module);
4450
int _PyTestCapi_Init_Structmember(PyObject *module);
4551
int _PyTestCapi_Init_Exceptions(PyObject *module);
4652
int _PyTestCapi_Init_Code(PyObject *module);
4753
int _PyTestCapi_Init_Buffer(PyObject *module);
4854
int _PyTestCapi_Init_PyAtomic(PyObject *module);
4955
int _PyTestCapi_Init_PyOS(PyObject *module);
56+
int _PyTestCapi_Init_File(PyObject *module);
57+
int _PyTestCapi_Init_Codec(PyObject *module);
5058
int _PyTestCapi_Init_Immortal(PyObject *module);
51-
int _PyTestCapi_Init_GC(PyObject *mod);
52-
int _PyTestCapi_Init_Sys(PyObject *);
59+
int _PyTestCapi_Init_GC(PyObject *module);
60+
int _PyTestCapi_Init_Sys(PyObject *module);
5361

5462
int _PyTestCapi_Init_VectorcallLimited(PyObject *module);
5563
int _PyTestCapi_Init_HeaptypeRelative(PyObject *module);

Modules/_testcapi/tuple.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include "parts.h"
2+
#include "util.h"
3+
4+
5+
static PyMethodDef test_methods[] = {
6+
{NULL},
7+
};
8+
9+
int
10+
_PyTestCapi_Init_Tuple(PyObject *m)
11+
{
12+
if (PyModule_AddFunctions(m, test_methods) < 0){
13+
return -1;
14+
}
15+
16+
return 0;
17+
}

0 commit comments

Comments
 (0)