BBR 1 Ebene

Committer:
borlanic
Date:
Mon May 14 11:29:06 2018 +0000
Revision:
0:fbdae7e6d805
BBR

Who changed what in which revision?

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