@@ -12,6 +12,79 @@ function ci_commit_formatting_run {
1212 tools/verifygitlog.py -v upstream/master..HEAD --no-merges
1313}
1414
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/fnmatch/fnmatch.py ~ /.micropython/lib/
31+ cp python-stdlib/shutil/shutil.py ~ /.micropython/lib/
32+ cp -r python-stdlib/unittest/unittest ~ /.micropython/lib/
33+ cp -r python-stdlib/unittest-discover/unittest ~ /.micropython/lib/
34+ cp unix-ffi/ffilib/ffilib.py ~ /.micropython/lib/
35+ tree ~ /.micropython
36+ }
37+
38+ function ci_package_tests_run {
39+ for test in \
40+ micropython/drivers/storage/sdcard/sdtest.py \
41+ micropython/xmltok/test_xmltok.py \
42+ python-ecosys/requests/test_requests.py \
43+ python-stdlib/argparse/test_argparse.py \
44+ python-stdlib/base64/test_base64.py \
45+ python-stdlib/binascii/test_binascii.py \
46+ python-stdlib/collections-defaultdict/test_defaultdict.py \
47+ python-stdlib/functools/test_partial.py \
48+ python-stdlib/functools/test_reduce.py \
49+ python-stdlib/heapq/test_heapq.py \
50+ python-stdlib/hmac/test_hmac.py \
51+ python-stdlib/itertools/test_itertools.py \
52+ python-stdlib/operator/test_operator.py \
53+ python-stdlib/os-path/test_path.py \
54+ python-stdlib/pickle/test_pickle.py \
55+ python-stdlib/string/test_translate.py \
56+ unix-ffi/gettext/test_gettext.py \
57+ unix-ffi/pwd/test_getpwnam.py \
58+ unix-ffi/re/test_re.py \
59+ unix-ffi/time/test_strftime.py \
60+ ; do
61+ echo " Running test $test "
62+ (cd ` dirname $test ` && $MICROPYTHON ` basename $test ` )
63+ if [ $? -ne 0 ]; then
64+ false # make this function return an error code
65+ return
66+ fi
67+ done
68+
69+ for path in \
70+ micropython/ucontextlib \
71+ python-stdlib/pathlib \
72+ python-stdlib/shutil \
73+ python-stdlib/tempfile \
74+ python-stdlib/time \
75+ python-stdlib/unittest-discover/tests \
76+ ; do
77+ (cd $path && $MICROPYTHON -m unittest)
78+ if [ $? -ne 0 ]; then false ; return ; fi
79+ done
80+
81+ (cd micropython/usb/usb-device && $MICROPYTHON -m tests.test_core_buffer)
82+ if [ $? -ne 0 ]; then false ; return ; fi
83+
84+ (cd python-ecosys/cbor2 && $MICROPYTHON -m examples.cbor_test)
85+ if [ $? -ne 0 ]; then false ; return ; fi
86+ }
87+
1588# #######################################################################################
1689# build packages
1790
0 commit comments