diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/bytemuck/scripts | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/bytemuck/scripts')
-rwxr-xr-x | third_party/rust/bytemuck/scripts/travis.sh | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/third_party/rust/bytemuck/scripts/travis.sh b/third_party/rust/bytemuck/scripts/travis.sh new file mode 100755 index 0000000000..31201ce6d2 --- /dev/null +++ b/third_party/rust/bytemuck/scripts/travis.sh @@ -0,0 +1,77 @@ +#!/bin/bash + +set -e + +if [[ "$RUN_MIRI" != "" ]]; then + + cargo clean + + # Install and run the latest version of nightly where miri built successfully. + # Taken from: https://github.com/rust-lang/miri#running-miri-on-ci + + MIRI_NIGHTLY=nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri) + echo "Installing latest nightly with Miri: $MIRI_NIGHTLY" + rustup set profile minimal + rustup default "$MIRI_NIGHTLY" + + rustup component add miri + cargo miri setup + + cargo miri test --verbose + cargo miri test --verbose --no-default-features + cargo miri test --verbose --all-features + +else + + rustup component add clippy + cargo clippy + + if [[ "$TARGET" != "" ]]; then rustup target install $TARGET; fi + + if [[ "$TARGET" == "wasm32-"* && "$TARGET" != "wasm32-wasi" ]]; then + cargo-web --version || cargo install cargo-web + cargo web test --no-default-features $FLAGS --target=$TARGET + cargo web test $FLAGS --target=$TARGET + #cargo web test --all-features $FLAGS --target=$TARGET + + elif [[ "$TARGET" == *"-linux-android"* ]]; then + export PATH=/usr/local/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH + pushd linux-android + cargo build --no-default-features --target=$TARGET $FLAGS + cargo build --target=$TARGET $FLAGS + #cargo build --all-features --target=$TARGET $FLAGS + # Don't test, can't run android emulators successfully on travis currently + popd + + elif [[ "$TARGET" == *"-apple-ios" || "$TARGET" == "wasm32-wasi" ]]; then + cargo build --no-default-features --target=$TARGET $FLAGS + cargo build --target=$TARGET $FLAGS + #cargo build --all-features --target=$TARGET $FLAGS + # Don't test + # iOS simulator setup/teardown is complicated + # cargo-web doesn't support wasm32-wasi yet, nor can wasm-pack test specify a target + + elif [[ "$TARGET" == *"-unknown-linux-gnueabihf" ]]; then + #sudo apt-get update + #sudo apt-get install -y gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf + pushd generic-cross + cargo build --no-default-features --target=$TARGET $FLAGS + cargo build --target=$TARGET $FLAGS + #cargo build --all-features --target=$TARGET $FLAGS + # Don't test + popd + + elif [[ "$TARGET" != "" ]]; then + pushd generic-cross + cargo test --no-default-features --target=$TARGET $FLAGS + cargo test --target=$TARGET $FLAGS + #cargo test --all-features --target=$TARGET $FLAGS + popd + + else + # Push nothing, target host CPU architecture + cargo test --no-default-features $FLAGS + cargo test $FLAGS + fi + +fi |