travis: Add automated coverage testing using coveralls.
This commit is contained in:
parent
b753009a38
commit
81e661f28b
15
.travis.yml
15
.travis.yml
@ -10,6 +10,8 @@ before_script:
|
|||||||
- sudo apt-get install -y python3.4 python3 gcc-4.7 gcc-multilib gcc-arm-none-eabi qemu-system mingw32
|
- sudo apt-get install -y python3.4 python3 gcc-4.7 gcc-multilib gcc-arm-none-eabi qemu-system mingw32
|
||||||
# For teensy build
|
# For teensy build
|
||||||
- sudo apt-get install realpath
|
- sudo apt-get install realpath
|
||||||
|
# For coverage testing
|
||||||
|
- sudo pip install cpp-coveralls
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- make -C minimal test
|
- make -C minimal test
|
||||||
@ -25,8 +27,17 @@ script:
|
|||||||
- make -C cc3200 BTARGET=bootloader BTYPE=release
|
- make -C cc3200 BTARGET=bootloader BTYPE=release
|
||||||
- make -C windows CROSS_COMPILE=i586-mingw32msvc-
|
- make -C windows CROSS_COMPILE=i586-mingw32msvc-
|
||||||
|
|
||||||
- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests)
|
# run tests without coverage info
|
||||||
- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests --emit native)
|
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests)
|
||||||
|
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests --emit native)
|
||||||
|
|
||||||
|
# run tests with coverage info
|
||||||
|
- make -C unix CC=gcc-4.7 coverage
|
||||||
|
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests)
|
||||||
|
- (cd tests && MICROPY_CPYTHON3=python3.4 MICROPY_MICROPYTHON=../unix/micropython_coverage ./run-tests --emit native)
|
||||||
|
|
||||||
|
after_success:
|
||||||
|
- (cd unix && coveralls --root .. --build-root . --gcov $(which gcov-4.7) --gcov-options '\-o build-coverage/' --include py --include extmod)
|
||||||
|
|
||||||
after_failure:
|
after_failure:
|
||||||
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
|
- (cd tests && for exp in *.exp; do testbase=$(basename $exp .exp); echo -e "\nFAILURE $testbase"; diff -u $testbase.exp $testbase.out; done)
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
[![Build Status][travis-img]][travis-repo]
|
[![Build Status][travis-img]][travis-repo] [![Coverage Status][coveralls-img]][coveralls-repo]
|
||||||
[travis-img]: https://travis-ci.org/micropython/micropython.png?branch=master
|
[travis-img]: https://travis-ci.org/micropython/micropython.png?branch=master
|
||||||
[travis-repo]: https://travis-ci.org/micropython/micropython
|
[travis-repo]: https://travis-ci.org/micropython/micropython
|
||||||
|
[coveralls-img]: https://coveralls.io/repos/micropython/micropython/badge.png?branch=travis-testing
|
||||||
|
[coveralls-repo]: https://coveralls.io/r/micropython/micropython?branch=travis-testing
|
||||||
|
|
||||||
The Micro Python project
|
The Micro Python project
|
||||||
========================
|
========================
|
||||||
|
@ -136,6 +136,8 @@ minimal:
|
|||||||
coverage:
|
coverage:
|
||||||
@echo Make sure to run make -B
|
@echo Make sure to run make -B
|
||||||
$(MAKE) COPT="-O0" CFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' BUILD=build-coverage PROG=micropython_coverage
|
$(MAKE) COPT="-O0" CFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' LDFLAGS_EXTRA='-fprofile-arcs -ftest-coverage' BUILD=build-coverage PROG=micropython_coverage
|
||||||
|
|
||||||
|
coverage_test: coverage
|
||||||
$(eval DIRNAME=$(notdir $(CURDIR)))
|
$(eval DIRNAME=$(notdir $(CURDIR)))
|
||||||
cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests
|
cd ../tests && MICROPY_MICROPYTHON=../$(DIRNAME)/micropython_coverage ./run-tests
|
||||||
gcov -o build-coverage/py ../py/*.c
|
gcov -o build-coverage/py ../py/*.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user