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