travis: Add tests for building and importing dynamic native modules.
squashed ---
Updated for Pycopy.
@@ -103,7 +103,10 @@ jobs:
- stage: test
env: NAME="unix coverage build and tests"
install:
+ - sudo apt-get install python3-pip
- sudo pip install cpp-coveralls
+ - sudo pip3 install setuptools
+ - sudo pip3 install pyelftools
- gcc --version
- python3 --version
script:
@@ -119,6 +122,17 @@ jobs:
- (cd tests && MICROPY_CPYTHON3=python3 MICROPY_MICROPYTHON=../ports/unix/pycopy_coverage ./run-tests --via-mpy --emit native -d basics float micropython)
# test when input script comes from stdin
- cat tests/basics/0prelim.py | ports/unix/pycopy_coverage | grep -q 'abc'
+ # test building native mpy modules
+ - make -C examples/natmod/features1 ARCH=x64
+ - make -C examples/natmod/features2 ARCH=x64
+ - make -C examples/natmod/btree ARCH=x64
+ - make -C examples/natmod/framebuf ARCH=x64
+ - make -C examples/natmod/uheapq ARCH=x64
+ - make -C examples/natmod/ure ARCH=x64
+ - make -C examples/natmod/uzlib ARCH=x64
+ # test importing .mpy generated by mpy_ld.py
+ - MICROPYPATH=examples/natmod/features2 ./ports/unix/pycopy_coverage -m features2
+ - (cd tests && ./run-natmodtests.py extmod/{btree*,framebuf*,uheapq*,ure*,uzlib*}.py)
# run coveralls coverage analysis (try to, even if some builds/tests failed)
- (cd ports/unix && coveralls --root ../.. --build-root . --gcov $(which gcov) --gcov-options '\-o build-coverage/' --include py --include extmod)
after_failure:
