Skip to content

Commit f66f257

Browse files
committed
update test case
1 parent 28bdac6 commit f66f257

File tree

4 files changed

+15
-6
lines changed

4 files changed

+15
-6
lines changed

tests/integration/testrpath/c/c.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int fc(void) {
2+
return 20;
3+
}

tests/integration/testrpath/c/c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
int fc(void);

tests/integration/testrpath/setup.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ class BuildExt(build_ext):
1111
def run(self) -> None:
1212
cmd = "gcc -fPIC -shared -o b/libb.so b/b.c"
1313
subprocess.check_call(cmd.split())
14+
15+
cmd = "gcc -fPIC -shared -o c/libc.so c/c.c"
16+
subprocess.check_call(cmd.split())
17+
1418
cmd = (
1519
"gcc -fPIC -shared -o a/liba.so "
16-
"-Wl,{dtags_flag} -Wl,-rpath=$ORIGIN/../b "
17-
"-Ib a/a.c -Lb -lb"
20+
"-Wl,{dtags_flag} -Wl,-rpath=$ORIGIN/../b -Wl,-rpath=$ORIGIN/../c "
21+
"-Ib a/a.c -Lb -Lc -lb -lc"
1822
).format(
1923
dtags_flag=(
2024
"--enable-new-dtags"
@@ -36,9 +40,9 @@ def run(self) -> None:
3640
Extension(
3741
"testrpath/testrpath",
3842
sources=["src/testrpath/testrpath.c"],
39-
include_dirs=["a"],
40-
libraries=["a"],
41-
library_dirs=["a"],
43+
include_dirs=["a", "c"],
44+
libraries=["a", "c"],
45+
library_dirs=["a", "c"],
4246
)
4347
],
4448
)

tests/integration/testrpath/src/testrpath/testrpath.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <Python.h>
22
#include "a.h"
3+
#include "c.h"
34

45
static PyObject *
56
func(PyObject *self, PyObject *args)
@@ -9,7 +10,7 @@ func(PyObject *self, PyObject *args)
910
(void)self;
1011
(void)args;
1112

12-
res = fa();
13+
res = fa() + fc();
1314
return PyLong_FromLong(res);
1415
}
1516

0 commit comments

Comments
 (0)