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