2018-11-03 11:08:30 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Check if any command failed
|
|
|
|
error=false
|
|
|
|
|
2019-01-23 17:04:45 -05:00
|
|
|
# Run clippy checks
|
|
|
|
if [ "$CLIPPY" == "true" ]; then
|
|
|
|
cargo clippy --all-targets
|
|
|
|
exit
|
2018-11-03 11:08:30 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Run test in release mode if a tag is present, to produce an optimized binary
|
|
|
|
if [ -n "$TRAVIS_TAG" ]; then
|
|
|
|
cargo test --release || error=true
|
|
|
|
else
|
|
|
|
cargo test || error=true
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Test the font subcrate
|
|
|
|
cargo test -p font || error=true
|
|
|
|
|
|
|
|
# Test the winpty subcrate
|
|
|
|
if [ "$TRAVIS_OS_NAME" == "windows" ]; then
|
2018-11-03 14:46:26 -04:00
|
|
|
if [ -n "$TRAVIS_TAG" ]; then
|
|
|
|
mkdir -p "./target/debug/deps"
|
|
|
|
cp "./target/release/winpty-agent.exe" "./target/debug/deps"
|
|
|
|
else
|
|
|
|
cp "./target/debug/winpty-agent.exe" "./target/debug/deps"
|
|
|
|
fi
|
|
|
|
cargo test -p winpty || error=true
|
2018-11-03 11:08:30 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ $error == "true" ]; then
|
|
|
|
exit 1
|
|
|
|
fi
|