From 95a8fe7d3fc70faca452a1c75800a4b53da483c0 Mon Sep 17 00:00:00 2001 From: Jean-Michel Picod <jmichel@google.com> Date: Thu, 6 Feb 2020 15:13:21 +0100 Subject: [PATCH] Enable Travis on OSX Only do the build/link check. The unit tests are only ran on linux. --- .travis.yml | 1 + run_desktop_tests.sh | 56 +++++++++++++++++++------------------------- 2 files changed, 25 insertions(+), 32 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f92d2c..c8bf19f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,6 +18,7 @@ rust: os: - linux + - osx addons: apt: diff --git a/run_desktop_tests.sh b/run_desktop_tests.sh index 11786e7..5f7807b 100755 --- a/run_desktop_tests.sh +++ b/run_desktop_tests.sh @@ -13,17 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -set -eu - -# Ensure we have the key_material.rs file before running the tests -if [ ! -f src/ctap/key_material.rs ] -then - echo "$(tput bold)ERROR:$(tput sgr0) Cannot find src/ctap/key_material.rs file." - echo "Please make sure that you have run the following script: ./setup.sh" - exit 2 -fi - -set -x +set -eux echo "Checking formatting..." cargo fmt --all -- --check @@ -46,27 +36,29 @@ cargo check --release --target=thumbv7em-none-eabi --examples echo "Checking that CTAP2 builds and links properly (1 set of features)..." cargo build --release --target=thumbv7em-none-eabi --features with_ctap1 -echo "Running unit tests on the desktop (release mode)..." -cd libraries/cbor -cargo test --release --features std -cd ../.. -cd libraries/crypto -RUSTFLAGS='-C target-feature=+aes' cargo test --release --features std,derive_debug -cd ../.. -cargo test --release --features std - -echo "Running unit tests on the desktop (debug mode)..." -cd libraries/cbor -cargo test --features std -cd ../.. -cd libraries/crypto -RUSTFLAGS='-C target-feature=+aes' cargo test --features std,derive_debug -cd ../.. -cargo test --features std +if [ "${TRAVIS_OS_NAME}" = "linux" ] +then + echo "Running unit tests on the desktop (release mode)..." + cd libraries/cbor + cargo test --release --features std + cd ../.. + cd libraries/crypto + RUSTFLAGS='-C target-feature=+aes' cargo test --release --features std,derive_debug + cd ../.. + cargo test --release --features std -echo "Running unit tests on the desktop (release mode + CTAP1)..." -cargo test --release --features std,with_ctap1 + echo "Running unit tests on the desktop (debug mode)..." + cd libraries/cbor + cargo test --features std + cd ../.. + cd libraries/crypto + RUSTFLAGS='-C target-feature=+aes' cargo test --features std,derive_debug + cd ../.. + cargo test --features std -echo "Running unit tests on the desktop (debug mode + CTAP1)..." -cargo test --features std,with_ctap1 + echo "Running unit tests on the desktop (release mode + CTAP1)..." + cargo test --release --features std,with_ctap1 + echo "Running unit tests on the desktop (debug mode + CTAP1)..." + cargo test --features std,with_ctap1 +fi -- GitLab