Erste version der Software für der Prototyp

Committer:
borlanic
Date:
Fri Mar 30 14:07:05 2018 +0000
Revision:
4:75df35ef4fb6
Parent:
0:380207fcb5c1
commentar

Who changed what in which revision?

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