Backup 1

Committer:
borlanic
Date:
Tue Apr 24 11:45:18 2018 +0000
Revision:
0:02dd72d1d465
BaBoRo_test2 - backup 1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:02dd72d1d465 1 language: python
borlanic 0:02dd72d1d465 2 python:
borlanic 0:02dd72d1d465 3 '2.7'
borlanic 0:02dd72d1d465 4
borlanic 0:02dd72d1d465 5 env:
borlanic 0:02dd72d1d465 6 global:
borlanic 0:02dd72d1d465 7 - >
borlanic 0:02dd72d1d465 8 STATUS=$'curl -so/dev/null --user "$MBED_BOT" --request POST
borlanic 0:02dd72d1d465 9 https://api.github.com/repos/$TRAVIS_REPO_SLUG/statuses/${TRAVIS_PULL_REQUEST_SHA:-$TRAVIS_COMMIT}
borlanic 0:02dd72d1d465 10 --data @- << DATA\n{
borlanic 0:02dd72d1d465 11 "state": "$0",
borlanic 0:02dd72d1d465 12 "description": "$1",
borlanic 0:02dd72d1d465 13 "context": "travis-ci/$NAME",
borlanic 0:02dd72d1d465 14 "target_url": "https://travis-ci.org/$TRAVIS_REPO_SLUG/jobs/$TRAVIS_JOB_ID"
borlanic 0:02dd72d1d465 15 }\nDATA'
borlanic 0:02dd72d1d465 16
borlanic 0:02dd72d1d465 17 cache:
borlanic 0:02dd72d1d465 18 pip: true
borlanic 0:02dd72d1d465 19 directories:
borlanic 0:02dd72d1d465 20 - $HOME/.cache/apt
borlanic 0:02dd72d1d465 21 - $HOME/gcc-arm-none-eabi-6-2017-q2-update
borlanic 0:02dd72d1d465 22
borlanic 0:02dd72d1d465 23 before_install:
borlanic 0:02dd72d1d465 24 - bash -c "$STATUS" pending "Local $NAME testing is in progress"
borlanic 0:02dd72d1d465 25 # Make sure pipefail
borlanic 0:02dd72d1d465 26 - set -o pipefail
borlanic 0:02dd72d1d465 27 # Setup apt to cache
borlanic 0:02dd72d1d465 28 - mkdir -p $HOME/.cache/apt/partial
borlanic 0:02dd72d1d465 29 - sudo rm -rf /var/cache/apt/archives
borlanic 0:02dd72d1d465 30 - sudo ln -s $HOME/.cache/apt /var/cache/apt/archives
borlanic 0:02dd72d1d465 31 # Setup ppa to make sure arm-none-eabi-gcc is correct version
borlanic 0:02dd72d1d465 32 - sudo add-apt-repository -y ppa:team-gcc-arm-embedded/ppa
borlanic 0:02dd72d1d465 33 # Loop until update succeeds (timeouts can occur)
borlanic 0:02dd72d1d465 34 - travis_retry $(! sudo apt-get update 2>&1 |grep Failed)
borlanic 0:02dd72d1d465 35
borlanic 0:02dd72d1d465 36 after_success:
borlanic 0:02dd72d1d465 37 - bash -c "$STATUS" success "Local $NAME testing has passed"
borlanic 0:02dd72d1d465 38
borlanic 0:02dd72d1d465 39 after_failure:
borlanic 0:02dd72d1d465 40 - bash -c "$STATUS" failure "Local $NAME testing has failed"
borlanic 0:02dd72d1d465 41
borlanic 0:02dd72d1d465 42 matrix:
borlanic 0:02dd72d1d465 43 include:
borlanic 0:02dd72d1d465 44 - env:
borlanic 0:02dd72d1d465 45 - NAME=docs
borlanic 0:02dd72d1d465 46 install:
borlanic 0:02dd72d1d465 47 # Install dependencies
borlanic 0:02dd72d1d465 48 - sudo apt-get install doxygen
borlanic 0:02dd72d1d465 49 # Print versions we use
borlanic 0:02dd72d1d465 50 - doxygen --version
borlanic 0:02dd72d1d465 51 before_script:
borlanic 0:02dd72d1d465 52 # Create BUILD directory for tests
borlanic 0:02dd72d1d465 53 - mkdir BUILD
borlanic 0:02dd72d1d465 54 script:
borlanic 0:02dd72d1d465 55 # Assert that the Doxygen build produced no warnings.
borlanic 0:02dd72d1d465 56 # The strange command below asserts that the Doxygen command had an
borlanic 0:02dd72d1d465 57 # output of zero length
borlanic 0:02dd72d1d465 58 - >
borlanic 0:02dd72d1d465 59 doxygen doxyfile_options 2>&1 |
borlanic 0:02dd72d1d465 60 tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
borlanic 0:02dd72d1d465 61 # Assert that all binary libraries are named correctly
borlanic 0:02dd72d1d465 62 # The strange command below asserts that there are exactly 0 libraries
borlanic 0:02dd72d1d465 63 # that do not start with lib
borlanic 0:02dd72d1d465 64 - >
borlanic 0:02dd72d1d465 65 find "(" -name "*.a" -or -name "*.ar" ")" -and -not -name "lib*" |
borlanic 0:02dd72d1d465 66 tee BUILD/badlibs |
borlanic 0:02dd72d1d465 67 sed -e "s/^/Bad library name found: /" && [ ! -s BUILD/badlibs ]
borlanic 0:02dd72d1d465 68 # Assert that all assebler files are named correctly
borlanic 0:02dd72d1d465 69 # The strange command below asserts that there are exactly 0 libraries
borlanic 0:02dd72d1d465 70 # that do end with .s
borlanic 0:02dd72d1d465 71 - >
borlanic 0:02dd72d1d465 72 find -name "*.s" | tee BUILD/badasm |
borlanic 0:02dd72d1d465 73 sed -e "s/^/Bad Assembler file name found: /" && [ ! -s BUILD/badasm ]
borlanic 0:02dd72d1d465 74
borlanic 0:02dd72d1d465 75 - env:
borlanic 0:02dd72d1d465 76 - NAME=tools
borlanic 0:02dd72d1d465 77 install:
borlanic 0:02dd72d1d465 78 # Install dependencies
borlanic 0:02dd72d1d465 79 - sudo apt-get install gcc-arm-embedded
borlanic 0:02dd72d1d465 80 - pip install -r requirements.txt
borlanic 0:02dd72d1d465 81 - pip install pytest pylint hypothesis mock coverage coveralls
borlanic 0:02dd72d1d465 82 # Print versions we use
borlanic 0:02dd72d1d465 83 - arm-none-eabi-gcc --version
borlanic 0:02dd72d1d465 84 - python --version
borlanic 0:02dd72d1d465 85 script:
borlanic 0:02dd72d1d465 86 # Run local testing on tools
borlanic 0:02dd72d1d465 87 - PYTHONPATH=. coverage run -a -m pytest tools/test
borlanic 0:02dd72d1d465 88 - python tools/test/pylint.py
borlanic 0:02dd72d1d465 89 - coverage run -a tools/project.py -S | sed -n '/^Total/p'
borlanic 0:02dd72d1d465 90 - coverage html
borlanic 0:02dd72d1d465 91 after_success:
borlanic 0:02dd72d1d465 92 # Coverage for tools
borlanic 0:02dd72d1d465 93 - coveralls
borlanic 0:02dd72d1d465 94 # Report success since we have overridden default behaviour
borlanic 0:02dd72d1d465 95 - bash -c "$STATUS" success "Local $NAME testing has passed"
borlanic 0:02dd72d1d465 96
borlanic 0:02dd72d1d465 97 - env:
borlanic 0:02dd72d1d465 98 - NAME=events
borlanic 0:02dd72d1d465 99 - EVENTS=events
borlanic 0:02dd72d1d465 100 install:
borlanic 0:02dd72d1d465 101 # Install dependencies
borlanic 0:02dd72d1d465 102 - sudo apt-get install gcc-arm-embedded
borlanic 0:02dd72d1d465 103 - pip install -r requirements.txt
borlanic 0:02dd72d1d465 104 # Print versions we use
borlanic 0:02dd72d1d465 105 - arm-none-eabi-gcc --version
borlanic 0:02dd72d1d465 106 - gcc --version
borlanic 0:02dd72d1d465 107 - python --version
borlanic 0:02dd72d1d465 108 script:
borlanic 0:02dd72d1d465 109 # Check that example compiles
borlanic 0:02dd72d1d465 110 - sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
borlanic 0:02dd72d1d465 111 - python tools/make.py -t GCC_ARM -m K64F --source=. --build=BUILD/K64F/GCC_ARM -j0
borlanic 0:02dd72d1d465 112 # Check that example compiles without rtos
borlanic 0:02dd72d1d465 113 - sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' $EVENTS/README.md > main.cpp
borlanic 0:02dd72d1d465 114 - rm -r rtos features/cellular features/netsocket features/frameworks BUILD
borlanic 0:02dd72d1d465 115 - python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0
borlanic 0:02dd72d1d465 116 # Run local equeue tests
borlanic 0:02dd72d1d465 117 - make -C $EVENTS/equeue test
borlanic 0:02dd72d1d465 118 # Run profiling tests
borlanic 0:02dd72d1d465 119 - make -C $EVENTS/equeue prof | tee prof
borlanic 0:02dd72d1d465 120 after_success:
borlanic 0:02dd72d1d465 121 # update status if we succeeded, compare with master if possible
borlanic 0:02dd72d1d465 122 - |
borlanic 0:02dd72d1d465 123 CURR=$(grep -o '[0-9]\+ cycles' prof | awk '{sum += $1} END {print sum}')
borlanic 0:02dd72d1d465 124 PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
borlanic 0:02dd72d1d465 125 | jq -re "select(.sha != \"$TRAVIS_COMMIT\")
borlanic 0:02dd72d1d465 126 | .statuses[] | select(.context == \"travis-ci/$NAME\").description
borlanic 0:02dd72d1d465 127 | capture(\"runtime is (?<runtime>[0-9]+)\").runtime" \
borlanic 0:02dd72d1d465 128 || echo 0)
borlanic 0:02dd72d1d465 129
borlanic 0:02dd72d1d465 130 STATUSM="Passed, runtime is ${CURR} cycles"
borlanic 0:02dd72d1d465 131 if [ "$PREV" -ne 0 ]
borlanic 0:02dd72d1d465 132 then
borlanic 0:02dd72d1d465 133 STATUSM="$STATUSM ($(python -c "print '%+d' % ($CURR-$PREV)") cycles)"
borlanic 0:02dd72d1d465 134 fi
borlanic 0:02dd72d1d465 135 - bash -c "$STATUS" success "$STATUSM"
borlanic 0:02dd72d1d465 136
borlanic 0:02dd72d1d465 137 - env:
borlanic 0:02dd72d1d465 138 - NAME=littlefs
borlanic 0:02dd72d1d465 139 - LITTLEFS=features/filesystem/littlefs
borlanic 0:02dd72d1d465 140 install:
borlanic 0:02dd72d1d465 141 # Install dependencies
borlanic 0:02dd72d1d465 142 - sudo apt-get install gcc-arm-embedded fuse libfuse-dev
borlanic 0:02dd72d1d465 143 - pip install -r requirements.txt
borlanic 0:02dd72d1d465 144 - git clone https://github.com/armmbed/spiflash-driver.git
borlanic 0:02dd72d1d465 145 # Print versions
borlanic 0:02dd72d1d465 146 - arm-none-eabi-gcc --version
borlanic 0:02dd72d1d465 147 - gcc --version
borlanic 0:02dd72d1d465 148 - python --version
borlanic 0:02dd72d1d465 149 - fusermount --version
borlanic 0:02dd72d1d465 150 before_script:
borlanic 0:02dd72d1d465 151 # Setup and patch littlefs-fuse
borlanic 0:02dd72d1d465 152 - git clone https://github.com/geky/littlefs-fuse littlefs_fuse
borlanic 0:02dd72d1d465 153 - git -C littlefs_fuse checkout 3f1ed6e37799e49e3710830dc6abb926d5503cf2
borlanic 0:02dd72d1d465 154 - echo '*' > littlefs_fuse/.mbedignore
borlanic 0:02dd72d1d465 155 - rm -rf littlefs_fuse/littlefs/*
borlanic 0:02dd72d1d465 156 - cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) littlefs_fuse/littlefs
borlanic 0:02dd72d1d465 157 # Create file-backed disk
borlanic 0:02dd72d1d465 158 - mkdir MOUNT
borlanic 0:02dd72d1d465 159 - sudo chmod a+rw /dev/loop0
borlanic 0:02dd72d1d465 160 - dd if=/dev/zero bs=512 count=2048 of=DISK
borlanic 0:02dd72d1d465 161 - losetup /dev/loop0 DISK
borlanic 0:02dd72d1d465 162 - CFLAGS="-Werror -Wno-format"
borlanic 0:02dd72d1d465 163 script:
borlanic 0:02dd72d1d465 164 # Check that example compiles
borlanic 0:02dd72d1d465 165 - export CFLAGS="-Werror -Wno-format"
borlanic 0:02dd72d1d465 166 - sed -n '/``` c++/,/```/{/```/d;p;}' $LITTLEFS/README.md > main.cpp
borlanic 0:02dd72d1d465 167 - python tools/make.py -t GCC_ARM -m K82F --source=. --build=BUILD/K82F/GCC_ARM -j0
borlanic 0:02dd72d1d465 168 # Run local littlefs tests
borlanic 0:02dd72d1d465 169 - make -C$LITTLEFS/littlefs test QUIET=1
borlanic 0:02dd72d1d465 170 # Run local littlefs tests with set of variations
borlanic 0:02dd72d1d465 171 - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=64 -DLFS_PROG_SIZE=64"
borlanic 0:02dd72d1d465 172 - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=1 -DLFS_PROG_SIZE=1"
borlanic 0:02dd72d1d465 173 - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_READ_SIZE=512 -DLFS_PROG_SIZE=512"
borlanic 0:02dd72d1d465 174 - make -C$LITTLEFS/littlefs test QUIET=1 CFLAGS+="-DLFS_BLOCK_COUNT=1023 -DLFS_LOOKAHEAD=2048"
borlanic 0:02dd72d1d465 175 - make -C$LITTLEFS/littlefs clean test QUIET=1 CFLAGS+="-DLFS_NO_INTRINSICS"
borlanic 0:02dd72d1d465 176 # Self-hosting littlefs fuzz test with littlefs-fuse
borlanic 0:02dd72d1d465 177 - make -Clittlefs_fuse
borlanic 0:02dd72d1d465 178 - littlefs_fuse/lfs --format /dev/loop0
borlanic 0:02dd72d1d465 179 - littlefs_fuse/lfs /dev/loop0 MOUNT
borlanic 0:02dd72d1d465 180 - ls MOUNT
borlanic 0:02dd72d1d465 181 - mkdir MOUNT/littlefs
borlanic 0:02dd72d1d465 182 - cp -r $(git ls-tree --name-only HEAD $LITTLEFS/littlefs/) MOUNT/littlefs
borlanic 0:02dd72d1d465 183 - ls MOUNT/littlefs
borlanic 0:02dd72d1d465 184 - CFLAGS="-Wno-format" make -CMOUNT/littlefs -B test_dirs test_files QUIET=1
borlanic 0:02dd72d1d465 185 # Compile and find the code size with smallest configuration
borlanic 0:02dd72d1d465 186 - cd $TRAVIS_BUILD_DIR/$LITTLEFS/littlefs
borlanic 0:02dd72d1d465 187 - make clean size
borlanic 0:02dd72d1d465 188 CC='arm-none-eabi-gcc -mthumb'
borlanic 0:02dd72d1d465 189 OBJ="$(ls lfs*.o | tr '\n' ' ')"
borlanic 0:02dd72d1d465 190 CFLAGS+="-DLFS_NO{ASSERT,DEBUG,WARN,ERROR}"
borlanic 0:02dd72d1d465 191 | tee sizes
borlanic 0:02dd72d1d465 192 after_success:
borlanic 0:02dd72d1d465 193 # update status if we succeeded, compare with master if possible
borlanic 0:02dd72d1d465 194 - |
borlanic 0:02dd72d1d465 195 CURR=$(tail -n1 sizes | awk '{print $1}')
borlanic 0:02dd72d1d465 196 PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
borlanic 0:02dd72d1d465 197 | jq -re "select(.sha != \"$TRAVIS_COMMIT\")
borlanic 0:02dd72d1d465 198 | .statuses[] | select(.context == \"travis-ci/$NAME\").description
borlanic 0:02dd72d1d465 199 | capture(\"code size is (?<size>[0-9]+)\").size" \
borlanic 0:02dd72d1d465 200 || echo 0)
borlanic 0:02dd72d1d465 201
borlanic 0:02dd72d1d465 202 STATUSM="Passed, code size is ${CURR}B"
borlanic 0:02dd72d1d465 203 if [ "$PREV" -ne 0 ]
borlanic 0:02dd72d1d465 204 then
borlanic 0:02dd72d1d465 205 STATUSM="$STATUSM ($(python -c "print '%+.2f' % (100*($CURR-$PREV)/$PREV.0)")%)"
borlanic 0:02dd72d1d465 206 fi
borlanic 0:02dd72d1d465 207 - bash -c "$STATUS" success "$STATUSM"
borlanic 0:02dd72d1d465 208
borlanic 0:02dd72d1d465 209 - env:
borlanic 0:02dd72d1d465 210 - NAME=gitattributestest
borlanic 0:02dd72d1d465 211 script:
borlanic 0:02dd72d1d465 212 # Check that no changes after clone. This check that .gitattributes is used right way.
borlanic 0:02dd72d1d465 213 - git diff --exit-code