Debian Codegraph @

debian/tests/module-install-local

raw symbols SCIP
1 #!/bin/sh
2
3 cp -a debian/tests/packages "$AUTOPKGTEST_TMP"
4 PY3_VER=$(pypy3 -c 'import sys; print("{}.{}".format(*sys.version_info[:2]))')
5 dist_packages=/usr/local/lib/pypy$PY3_VER/dist-packages
6
7 setUp() {
8 mount -t tmpfs tmpfs $dist_packages
9 }
10
11 tearDown() {
12 umount $dist_packages
13 }
14
15 testFibPy() {
16 cd "$AUTOPKGTEST_TMP/packages/fibpy"
17 pypy3 setup.py install
18 assertTrue 'Install fibpy in /usr/local' $?
19 assertTrue 'fibpy was installed to /usr/local' "[ -e $dist_packages/fibpy-*.egg ]"
20 cd "$AUTOPKGTEST_TMP"
21 stdout=$(pypy3 -m fibpy 5)
22 assertTrue 'Execute fibpy from /usr/local' $?
23 assertEquals 'Correct result' 8 "$stdout"
24 }
25
26 testFibC() {
27 cd "$AUTOPKGTEST_TMP/packages/fibc"
28 pypy3 setup.py install
29 assertTrue 'Install fibc in /usr/local' $?
30 assertTrue 'fibc was installed to /usr/local' "[ -e $dist_packages/fibc-*.egg ]"
31 cd "$AUTOPKGTEST_TMP"
32 stdout=$(pypy3 -c 'from fibc import fib; print(fib(5))')
33 assertTrue 'Execute fibc from /usr/local' $?
34 assertEquals 'Correct result' 8 "$stdout"
35 }
36
37 testFibCFFI() {
38 cd "$AUTOPKGTEST_TMP/packages/fibcffi"
39 pypy3 setup.py install
40 assertTrue 'Install fibcffi in /usr/local' $?
41 assertTrue 'fibcffi was installed to /usr/local' "[ -e $dist_packages/fibcffi-*.egg ]"
42 cd "$AUTOPKGTEST_TMP"
43 stdout=$(pypy3 -m fibcffi 5)
44 assertTrue 'Execute fibcffi from /usr/local' $?
45 assertEquals 'Correct result' 8 "$stdout"
46 }
47
48 testFibPyDevelop() {
49 cd "$AUTOPKGTEST_TMP/packages/fibpy"
50 pypy3 setup.py develop
51 assertTrue 'Install editable fibpy in /usr/local' $?
52 assertTrue 'fibpy was linked to /usr/local' "[ -e $dist_packages/fibpy.egg-link ]"
53 cd "$AUTOPKGTEST_TMP"
54 stdout=$(pypy3 -m fibpy 5)
55 assertTrue 'Execute editable fibpy from /usr/local' $?
56 assertEquals 'Correct result' 8 "$stdout"
57 }
58
59 testFibPyPip() {
60 cd "$AUTOPKGTEST_TMP"
61 pypy3 -m pip install --no-build-isolation --break-system-packages -v \
62 "$AUTOPKGTEST_TMP/packages/fibpy"
63 assertTrue 'Install fibpy via pip in /usr/local' $?
64 assertTrue 'fibpy was installed to /usr/local' "[ -e $dist_packages/fibpy.py ]"
65 stdout=$(pypy3 -m fibpy 5)
66 assertTrue 'Execute fibpy from /usr/local' $?
67 assertEquals 'Correct result' 8 "$stdout"
68 }
69
70 testFibPyPipEditable() {
71 cd "$AUTOPKGTEST_TMP"
72 pypy3 -m pip install --no-build-isolation --break-system-packages -v -e \
73 "$AUTOPKGTEST_TMP/packages/fibpy"
74 assertTrue 'Install editable fibpy via pip in /usr/local' $?
75 assertTrue 'fibpy was linked to /usr/local' "[ -e $dist_packages/__editable__.fibpy-42.0.0.pth ]"
76 stdout=$(pypy3 -m fibpy 5)
77 assertTrue 'Execute fibpy from /usr/local' $?
78 assertEquals 'Correct result' 8 "$stdout"
79 }
80
81 testFibPyDistutilsLocal() {
82 cd "$AUTOPKGTEST_TMP/packages/fibpy"
83 SETUPTOOLS_USE_DISTUTILS=local pypy3 setup.py install
84 assertTrue 'Install fibpy in /usr/local' $?
85 assertTrue 'fibpy was installed to /usr/local' "[ -e $dist_packages/fibpy-*.egg ]"
86 cd "$AUTOPKGTEST_TMP"
87 stdout=$(pypy3 -m fibpy 5)
88 assertTrue 'Execute fibpy from /usr/local' $?
89 assertEquals 'Correct result' 8 "$stdout"
90 }
91
92 . shunit2