summaryrefslogtreecommitdiffstats
path: root/third_party/rust/mach/ci/run.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/mach/ci/run.sh
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/mach/ci/run.sh')
-rwxr-xr-xthird_party/rust/mach/ci/run.sh57
1 files changed, 57 insertions, 0 deletions
diff --git a/third_party/rust/mach/ci/run.sh b/third_party/rust/mach/ci/run.sh
new file mode 100755
index 0000000000..9d814705c9
--- /dev/null
+++ b/third_party/rust/mach/ci/run.sh
@@ -0,0 +1,57 @@
+#!/usr/bin/env sh
+
+set -ex
+
+: "${TARGET?The TARGET environment variable must be set.}"
+: "${TRAVIS_RUST_VERSION?The TRAVIS_RUST_VERSION environment variable must be set.}"
+
+echo "Running tests for target: ${TARGET}"
+export RUST_BACKTRACE=1
+export RUST_TEST_THREADS=1
+export RUST_TEST_NOCAPTURE=1
+export CARGO_INCREMENTAL=0
+export CARGO_CODEGEN_UNITS=1
+export RUSTFLAGS="-C codegen-units=1 "
+
+case "${TARGET}" in
+ *"ios"*)
+ export RUSTFLAGS="${RUSTFLAGS} -C link-args=-mios-simulator-version-min=7.0"
+ rustc ./ci/deploy_and_run_on_ios_simulator.rs -o ios_cargo_runner --verbose
+ if [ "${TARGET}" = "x86_64-apple-ios" ]; then
+ export CARGO_TARGET_X86_64_APPLE_IOS_RUNNER
+ CARGO_TARGET_X86_64_APPLE_IOS_RUNNER="$(pwd)/ios_cargo_runner"
+ fi
+ if [ "${TARGET}" = "i386-apple-ios" ]; then
+ export CARGO_TARGET_I386_APPLE_IOS_RUNNER
+ CARGO_TARGET_I386_APPLE_IOS_RUNNER="$(pwd)/ios_cargo_runner"
+ fi
+ ;;
+ *)
+ ;;
+esac
+
+# Build w/o std
+cargo clean
+cargo build --no-default-features --target "${TARGET}" -vv 2>&1 | tee build_no_std.txt
+
+# Check that the no-std builds are not linked against a libc with default
+# features or the std feature enabled:
+! grep -q "default" build_no_std.txt
+! grep -q "std" build_no_std.txt
+# Make sure that the resulting build contains no std symbols
+! find target/ -name "*.rlib" -exec nm {} \; | grep "std"
+
+# Runs mach's run-time tests:
+if [ -z "$NORUN" ]; then
+ cargo test --target "${TARGET}" -vv
+ cargo test --target "${TARGET}" -vv --features deprecated
+ cargo test --no-default-features --target "${TARGET}" -vv
+fi
+
+# Runs ctest to verify mach's ABI against the system libraries:
+if [ -z "$NOCTEST" ]; then
+ if [ "${TRAVIS_RUST_VERSION}" = "nightly" ]; then
+ cargo test --manifest-path mach-test/Cargo.toml --target "${TARGET}" -vv
+ cargo test --no-default-features --manifest-path mach-test/Cargo.toml --target "${TARGET}" -vv
+ fi
+fi