@@ -12,6 +12,75 @@ 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 -r python-stdlib/unittest/unittest ~ /.micropython-lib
31
+ tree ~ /.micropython
32
+ }
33
+
34
+ function ci_package_tests_run {
35
+ for test in \
36
+ micropython/drivers/storage/sdcard/sdtest.py \
37
+ micropython/xmltok/test_xmltok.py \
38
+ python-ecosys/requests/test_requests.py \
39
+ python-stdlib/argparse/test_argparse.py \
40
+ python-stdlib/base64/test_base64.py \
41
+ python-stdlib/binascii/test_binascii.py \
42
+ python-stdlib/collections-defaultdict/test_defaultdict.py \
43
+ python-stdlib/functools/test_partial.py \
44
+ python-stdlib/functools/test_reduce.py \
45
+ python-stdlib/heapq/test_heapq.py \
46
+ python-stdlib/hmac/test_hmac.py \
47
+ python-stdlib/itertools/test_itertools.py \
48
+ python-stdlib/operator/test_operator.py \
49
+ python-stdlib/os-path/test_path.py \
50
+ python-stdlib/pickle/test_pickle.py \
51
+ python-stdlib/string/test_translate.py \
52
+ python-stdlib/tempfile/test_tempfile.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/unittest-discover/tests \
72
+ ; do
73
+ (cd $path && $MICROPYTHON -m unittest)
74
+ if [ $? -ne 0 ]; then false ; return ; fi
75
+ done
76
+
77
+ (cd micropython/usb/usb-device && $MICROPYTHON -m tests.test_core_buffer)
78
+ if [ $? -ne 0 ]; then false ; return ; fi
79
+
80
+ (cd python-ecosys/cbor2 && $MICROPYTHON -m examples.cbor_test)
81
+ if [ $? -ne 0 ]; then false ; return ; fi
82
+ }
83
+
15
84
# #######################################################################################
16
85
# build packages
17
86
0 commit comments