1
1
#! /bin/bash
2
2
3
+ CP=/bin/cp
4
+
3
5
# #######################################################################################
4
6
# commit formatting
5
7
@@ -12,6 +14,87 @@ function ci_commit_formatting_run {
12
14
tools/verifygitlog.py -v upstream/master..HEAD --no-merges
13
15
}
14
16
17
+ # #######################################################################################
18
+ # package tests
19
+
20
+ MICROPYTHON=/tmp/micropython/ports/unix/build-standard/micropython
21
+
22
+ function ci_package_tests_setup_micropython {
23
+ git clone https://github.com/micropython/micropython.git /tmp/micropython
24
+
25
+ # build mpy-cross and micropython (use -O0 to speed up the build)
26
+ make -C /tmp/micropython/mpy-cross -j CFLAGS_EXTRA=-O0
27
+ make -C /tmp/micropython/ports/unix submodules
28
+ make -C /tmp/micropython/ports/unix -j CFLAGS_EXTRA=-O0
29
+ }
30
+
31
+ function ci_package_tests_setup_lib {
32
+ mkdir -p ~ /.micropython/lib
33
+ $CP micropython/ucontextlib/ucontextlib.py ~ /.micropython/lib/
34
+ $CP python-stdlib/fnmatch/fnmatch.py ~ /.micropython/lib/
35
+ $CP python-stdlib/shutil/shutil.py ~ /.micropython/lib/
36
+ $CP python-stdlib/tempfile/tempfile.py ~ /.micropython/lib/
37
+ $CP -r python-stdlib/unittest/unittest ~ /.micropython/lib/
38
+ $CP -r python-stdlib/unittest-discover/unittest ~ /.micropython/lib/
39
+ $CP unix-ffi/ffilib/ffilib.py ~ /.micropython/lib/
40
+ tree ~ /.micropython
41
+ }
42
+
43
+ function ci_package_tests_run {
44
+ for test in \
45
+ micropython/drivers/storage/sdcard/sdtest.py \
46
+ micropython/xmltok/test_xmltok.py \
47
+ python-ecosys/requests/test_requests.py \
48
+ python-stdlib/argparse/test_argparse.py \
49
+ python-stdlib/base64/test_base64.py \
50
+ python-stdlib/binascii/test_binascii.py \
51
+ python-stdlib/collections-defaultdict/test_defaultdict.py \
52
+ python-stdlib/functools/test_partial.py \
53
+ python-stdlib/functools/test_reduce.py \
54
+ python-stdlib/heapq/test_heapq.py \
55
+ python-stdlib/hmac/test_hmac.py \
56
+ python-stdlib/itertools/test_itertools.py \
57
+ python-stdlib/operator/test_operator.py \
58
+ python-stdlib/os-path/test_path.py \
59
+ python-stdlib/pickle/test_pickle.py \
60
+ python-stdlib/string/test_translate.py \
61
+ unix-ffi/gettext/test_gettext.py \
62
+ unix-ffi/pwd/test_getpwnam.py \
63
+ unix-ffi/re/test_re.py \
64
+ unix-ffi/time/test_strftime.py \
65
+ ; do
66
+ echo " Running test $test "
67
+ (cd ` dirname $test ` && $MICROPYTHON ` basename $test ` )
68
+ if [ $? -ne 0 ]; then
69
+ false # make this function return an error code
70
+ return
71
+ fi
72
+ done
73
+
74
+ for path in \
75
+ micropython/ucontextlib \
76
+ python-stdlib/contextlib \
77
+ python-stdlib/datetime \
78
+ python-stdlib/fnmatch \
79
+ python-stdlib/hashlib \
80
+ python-stdlib/pathlib \
81
+ python-stdlib/quopri \
82
+ python-stdlib/shutil \
83
+ python-stdlib/tempfile \
84
+ python-stdlib/time \
85
+ python-stdlib/unittest-discover/tests \
86
+ ; do
87
+ (cd $path && $MICROPYTHON -m unittest)
88
+ if [ $? -ne 0 ]; then false ; return ; fi
89
+ done
90
+
91
+ (cd micropython/usb/usb-device && $MICROPYTHON -m tests.test_core_buffer)
92
+ if [ $? -ne 0 ]; then false ; return ; fi
93
+
94
+ (cd python-ecosys/cbor2 && $MICROPYTHON -m examples.cbor_test)
95
+ if [ $? -ne 0 ]; then false ; return ; fi
96
+ }
97
+
15
98
# #######################################################################################
16
99
# build packages
17
100
0 commit comments