improve travis fold status reporting; fix sphinx build; fix sphinx errors

This commit is contained in:
Dan Halbert 2019-01-09 13:31:32 -05:00
parent 47a9d14ba6
commit e47decbdc5
7 changed files with 41 additions and 22 deletions

View File

@ -74,7 +74,7 @@ before_script:
- sudo apt-get install -y python3-pip
- pip3 install --user sh click
- ([[ -z "$TRAVIS_TESTS" ]] || sudo pip install --upgrade cpp-coveralls)
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user 'Sphinx<1.8.0' sphinx-rtd-theme recommonmark)
- (! var_search "${TRAVIS_TESTS-}" docs || pip install --user 'Sphinx<1.8.0' sphinx-rtd-theme 'recommonmark<0.5.0')
- (! var_search "${TRAVIS_TESTS-}" translations || pip3 install --user polib)
# report some good version numbers to the build
@ -86,8 +86,8 @@ before_script:
script:
# Build mpy-cross first because other builds depend on it.
- echo 'Building mpy-cross' && echo 'travis_fold:start:mpy-cross'
- make -C mpy-cross -j2 ; echo status $? > status
- echo 'travis_fold:end:mpy-cross' && cat status
- make -C mpy-cross -j2 ; echo $? > status
- echo 'travis_fold:end:mpy-cross' && tools/print_status.py status
# Use unbuffered output because building all the releases can take a long time.
# Travis will cancel the job if it sees no output for >10 minutes.
@ -95,8 +95,8 @@ script:
- cd ..
- echo 'Building unix' && echo 'travis_fold:start:unix'
- (! var_search "${TRAVIS_TESTS-}" unix || (make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; echo status $? > status
- echo 'travis_fold:end:unix' && cat status
- (! var_search "${TRAVIS_TESTS-}" unix || (make -C ports/unix deplibs -j2 && make -C ports/unix -j2 && make -C ports/unix coverage -j2)) ; echo $? > status
- echo 'travis_fold:end:unix' && tools/print_status.py status
# run tests without coverage info
#- (cd tests && MICROPY_CPYTHON3=python3.4 ./run-tests -j1)
@ -104,28 +104,28 @@ script:
# run tests with coverage info
- echo 'Test all' && echo 'travis_fold:start:test_all'
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1)) ; echo status $? > status
- echo 'travis_fold:end:test_all' && cat status
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1)) ; echo $? > status
- echo 'travis_fold:end:test_all' && tools/print_status.py status
- echo 'Test threads' && echo 'travis_fold:start:test_threads'
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 -d thread)) ; echo status $? >status
- echo 'travis_fold:end:test_threads' && cat status
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 -d thread)) ; echo $? >status
- echo 'travis_fold:end:test_threads' && tools/print_status.py status
- echo 'Testing with native' && echo 'travis_fold:start:test_native'
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native)) ; echo status $? >status
- echo 'travis_fold:end:test_native' && cat status
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --emit native)) ; echo $? >status
- echo 'travis_fold:end:test_native' && tools/print_status.py status
- (echo 'Testing with mpy' && echo 'travis_fold:start:test_mpy')
- (! var_search "${TRAVIS_TESTS-}" unix || (cd tests && MICROPY_CPYTHON3=python3.5 MICROPY_MICROPYTHON=../ports/unix/micropython_coverage ./run-tests -j1 --via-mpy -d basics float)) ; echo "Testing with mpy status: $?" >status
- echo 'travis_fold:end:test_mpy' && cat status
- echo 'travis_fold:end:test_mpy' && tools/print_status.py status
- (echo 'Building docs' && echo 'travis_fold:start:build_docs')
- (! var_search "${TRAVIS_TESTS-}" docs || sphinx-build -E -W -b html . _build/html) ; echo status $? >status
- echo 'travis_fold:end:build_docs' && cat status
- (! var_search "${TRAVIS_TESTS-}" docs || sphinx-build -E -W -b html . _build/html) ; echo $? >status
- echo 'travis_fold:end:build_docs' && tools/print_status.py status
- (echo 'Building translations' && echo 'travis_fold:start:build_translations')
- (! var_search "${TRAVIS_TESTS-}" translations || make check-translate) ; echo status $? >status
- echo 'travis_fold:end:build_translations' && cat status
- (! var_search "${TRAVIS_TESTS-}" translations || make check-translate) ; echo $? >status
- echo 'travis_fold:end:build_translations' && tools/print_status.py status
# 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)

View File

@ -157,7 +157,7 @@ Behavior
API
~~~
- Unified hardware APIs: `audioio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/audioio/__init__.html>`_, `analogio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/analogio/__init__.html>`_, `busio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/__init__.html>`_, `digitalio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/digitalio/__init__.html>`_, `pulseio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html>`_, `touchio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/__init__.html>`_, `microcontroller <https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/__init__.html>`_, `board <https://circuitpython.readthedocs.io/en/latest/shared-bindings/board/__init__.html>`_, `bitbangio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitbangio/__init__.html>`_
- Unified hardware APIs: `audioio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/audioio/__init__.html>`_, `analogio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/analogio/__init__.html>`_, `bleio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bleio/__init__.html>`_, `busio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/busio/__init__.html>`_, `digitalio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/digitalio/__init__.html>`_, `pulseio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/pulseio/__init__.html>`_, `touchio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/touchio/__init__.html>`_, `microcontroller <https://circuitpython.readthedocs.io/en/latest/shared-bindings/microcontroller/__init__.html>`_, `board <https://circuitpython.readthedocs.io/en/latest/shared-bindings/board/__init__.html>`_, `bitbangio <https://circuitpython.readthedocs.io/en/latest/shared-bindings/bitbangio/__init__.html>`_
- No ``machine`` API on Atmel SAMD21 port.
Modules

View File

@ -42,7 +42,8 @@
//|
//| :param bleio.Characteristic characteristic: The characteristic to monitor
//| :param int buffer_size: Size of ring buffer that stores incoming data coming from client.
//| Must be >= 1.
//| Must be >= 1.
//|
STATIC mp_obj_t bleio_characteristic_buffer_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 1, 2, true);
bleio_characteristic_buffer_obj_t *self = m_new_obj(bleio_characteristic_buffer_obj_t);

View File

@ -52,10 +52,10 @@
//| When a device is created without any parameter passed to the constructor,
//| it will be set to the Peripheral role. If a address is passed, the device
//| will be a Central. For a Peripheral you can set the `name`, add services
//| via `add_service` and then start and stop advertising via `start_advertising`
//| and `stop_advertising`. For the Central, you can `bleio.Device.connect` and `bleio.Device.disconnect`
//| via `add_service` and then start and stop advertising via `bleio.Device.start_advertising`
//| and `bleio.Device.stop_advertising`. For the Central, you can `bleio.Device.connect` and `bleio.Device.disconnect`
//| to the device, once a connection is established, the device's services can
//| be accessed using `services`.
//| be accessed using `bleio.Device.services`.
//|
//| Usage::
//|

View File

@ -50,7 +50,7 @@
//| - a buffer object (bytearray, bytes) of 16 bytes in little-endian order (128-bit UUID)
//|
//| :param int/buffer value: The uuid value to encapsulate
//|
STATIC mp_obj_t bleio_uuid_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *pos_args) {
mp_arg_check_num(n_args, n_kw, 1, 1, false);

View File

@ -57,9 +57,12 @@
//| AddressType
//| AdvertisementData
//| Adapter
//| Broadcaster
//| Characteristic
//| CharacteristicBuffer
//| Descriptor
//| Device
//| Peripheral
//| ScanEntry
//| Scanner
//| Service

15
tools/print_status.py Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env python3
import sys
if len(sys.argv) != 2:
print("""\
Usage: print_status.py STATUS_FILENAME
STATUS_FILENAME contains one line with an integer status."""
)
sys.exit(1)
with open(sys.argv[1], 'r') as status_in:
status = int(status_in.readline())
print('{} with status {}'.format(
"\033[32msucceeded\033[0m" if status == 0 else "\033[31mfailed\033[0m",
status))