From 12da3798c360a3a8573b0247ffabd704ba1130c9 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Nov 2016 18:46:51 -0800 Subject: [PATCH 1/5] Add a bare bones README --- README.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f125d85 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# `av4-fc` + +Flight controller. From 3b61d9b78d9a512f735d1bc81c6ede1e43ee6611 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Nov 2016 18:47:54 -0800 Subject: [PATCH 2/5] Update Cargo.lock library versions --- Cargo.lock | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 47c1263..11eaa2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -51,3 +51,11 @@ dependencies = [ "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[metadata] +"checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3" +"checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" +"checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" +"checksum byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e4ca3a1755927e5b00c3fe43250053b957b5c074d9f17782b88ef7aa0fb4dfe2" +"checksum i2cdev 0.2.0 (git+https://github.com/rust-embedded/rust-i2cdev.git)" = "" +"checksum libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "52f45f4d4d75de96cf7f8b0e37b6a8e2f96619749b80bd79aa9f5a3100d63208" +"checksum nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f05c2fc965fc1cd6b73fa57fa7b89f288178737f2f3ce9e63e4a6a141189000e" From 62bd50d914e3063001b1104252f48efc80177cef Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Nov 2016 19:00:07 -0800 Subject: [PATCH 3/5] Add Travis CI and coveralls.io integration --- .coveralls.yml | 0 .travis.yml | 40 ++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 3 +++ README.md | 2 ++ coverage | 26 ++++++++++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 .coveralls.yml create mode 100644 .travis.yml create mode 100755 coverage diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..e69de29 diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..b1f6d29 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,40 @@ +sudo: false + +language: rust + +os: +- linux + +rust: +- nightly +- beta +- stable + +addons: + apt: + packages: + - libcurl4-openssl-dev + - libelf-dev + - libdw-dev + - binutils-dev + +before_script: +- pip install -v 'travis-cargo<0.2' --user +- if [[ -e ~/.local/bin ]]; then export PATH=~/.local/bin:$PATH; fi +- echo PATH is $PATH + +script: +- | + travis-cargo build && + travis-cargo test && + travis-cargo bench && + travis-cargo --only stable doc + +after_success: +- travis-cargo --only stable doc-upload +- travis-cargo coveralls --no-sudo --verify +- if [[ "$TRAVIS_RUST_VERSION" == "nightly" ]]; then KCOV=./kcov/build/src/kcov ./coverage; fi + +env: + global: + - TRAVIS_CARGO_NIGHTLY_FEATURE=nightly diff --git a/Cargo.toml b/Cargo.toml index d027b2f..d89e604 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,3 +6,6 @@ authors = ["jamey "] [dependencies] i2cdev = { git = "https://github.com/rust-embedded/rust-i2cdev.git" } byteorder = "0.5" + +[features] +nightly = [] diff --git a/README.md b/README.md index f125d85..cba427f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ # `av4-fc` +[![Build Status](https://travis-ci.org/psas/av4-fc.png?branch=master)](https://travis-ci.org/psas/av4-fc) [![Coverage Status](https://coveralls.io/repos/github/psas/av4-fc/badge.svg?branch=master)](https://coveralls.io/github/psas/av4-fc?branch=master) + Flight controller. diff --git a/coverage b/coverage new file mode 100755 index 0000000..1de0358 --- /dev/null +++ b/coverage @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# +# Usage: +# ./coverage +# +# Run kcov on the tests, and merge the results. +# +# Environment variables: +# TRAVIS_JOB_ID - id for coveralls, defaults to none +# KCOV - path to kcov, defaults to 'kcov' + +[ -n "$TRAVIS_JOB_ID" ] && COVERALLS_ID="--coveralls-id=$TRAVIS_JOB_ID" +[ -z "$KCOV" ] && KCOV=kcov + +# Rebuild tests with dead code included, and get a list of the filenames. +export RUSTFLAGS="-C link-dead-code" +TEST_FILES=$(cargo test 2>&1 >/dev/null | awk '/^ Running target\/debug\// { print $2 }') + +KCOV_OPTS="--verify --exclude-pattern=/.cargo" +OUT_DIR=target/kcov + +for f in $TEST_FILES; do + "$KCOV" $KCOV_OPTS "$OUT_DIR" $f +done +"$KCOV" --merge $KCOV_OPTS $COVERALLS_ID "$OUT_DIR" "$OUT_DIR" + From dce237984390b497be6ee3135378f9edb6311a40 Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Nov 2016 19:12:42 -0800 Subject: [PATCH 4/5] Start using `i2cdev` versions from crates.io rather than git --- Cargo.lock | 103 +++++++++++++++++++++++++++++++++++++++++++++-------- Cargo.toml | 2 +- 2 files changed, 90 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11eaa2a..6c920c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,8 +2,8 @@ name = "mpu9150" version = "0.1.0" dependencies = [ - "byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "i2cdev 0.2.0 (git+https://github.com/rust-embedded/rust-i2cdev.git)", + "byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "i2cdev 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -23,39 +23,114 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "byteorder" -version = "0.5.1" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "cfg-if" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "getopts" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "i2cdev" -version = "0.2.0" -source = "git+https://github.com/rust-embedded/rust-i2cdev.git#b75b6df919897654eccd59cc8f2dd3a3947e83dc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "skeptic 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "libc" -version = "0.2.8" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "nix" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "pulldown-cmark" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rand" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "rustc_version" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "semver" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "skeptic" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tempdir" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [metadata] "checksum bitflags 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dead7461c1127cf637931a1e50934eb6eee8bff2f74433ac7909e9afcee04a3" "checksum bitflags 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4f67931368edf3a9a51d29886d245f1c3db2f1ef0dcc9e35ff70341b78c10d23" "checksum byteorder 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "96c8b41881888cc08af32d47ac4edd52bc7fa27fef774be47a92443756451304" -"checksum byteorder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e4ca3a1755927e5b00c3fe43250053b957b5c074d9f17782b88ef7aa0fb4dfe2" -"checksum i2cdev 0.2.0 (git+https://github.com/rust-embedded/rust-i2cdev.git)" = "" -"checksum libc 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "52f45f4d4d75de96cf7f8b0e37b6a8e2f96619749b80bd79aa9f5a3100d63208" -"checksum nix 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f05c2fc965fc1cd6b73fa57fa7b89f288178737f2f3ce9e63e4a6a141189000e" +"checksum byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0fc10e8cc6b2580fda3f36eb6dc5316657f812a3df879a44a66fc9f0fdbc4855" +"checksum cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de1e760d7b6535af4241fca8bd8adf68e2e7edacc6b29f5d399050c5e48cf88c" +"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" +"checksum i2cdev 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d202d2e722bc94a27fe8510f171e092fd5f588069ea162feaa2f5cbe286e8fc" +"checksum libc 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "044d1360593a78f5c8e5e710beccdc24ab71d1f01bc19a29bcacdba22e8475d8" +"checksum nix 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a7bb1da2be7da3cbffda73fc681d509ffd9e665af478d2bee1907cee0bc64b2" +"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07" +"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" +"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" +"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" +"checksum skeptic 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "061203a849117b0f7090baf8157aa91dac30545208fbb85166ac58b4ca33d89c" +"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" diff --git a/Cargo.toml b/Cargo.toml index d89e604..de7fc35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" authors = ["jamey "] [dependencies] -i2cdev = { git = "https://github.com/rust-embedded/rust-i2cdev.git" } +i2cdev = "0.3.1" byteorder = "0.5" [features] From bec5e1e13b99f44ba01191e52c94b61f1f80f61d Mon Sep 17 00:00:00 2001 From: Nick Fitzgerald Date: Tue, 29 Nov 2016 19:20:11 -0800 Subject: [PATCH 5/5] Temporary hack around https://github.com/rust-lang/cargo/issues/598 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index b1f6d29..32ffafc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ before_script: - pip install -v 'travis-cargo<0.2' --user - if [[ -e ~/.local/bin ]]; then export PATH=~/.local/bin:$PATH; fi - echo PATH is $PATH +- export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt script: - |