mirror of
https://github.com/girlbossceo/jemallocator.git
synced 2024-11-26 16:31:08 +00:00
38 lines
1.2 KiB
Bash
Executable file
38 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
set -ex
|
|
|
|
: ${TARGET?"The TARGET 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_CMD=cross
|
|
|
|
# Runs jemalloc tests using "make check":
|
|
#export JEMALLOC_SYS_RUN_TESTS=1
|
|
|
|
# Use cargo on native CI platforms:
|
|
if [[ ${TARGET} = *"windows"* ]] || \
|
|
[[ ${TARGET} = *"x86_64-unknown-linux-gnu"* ]] || [[ ${TARGET} = *"i686-unknown-linux-gnu"* ]] || [[ ${TARGET} = *"i586-unknown-linux-gnu"* ]] \
|
|
|| [[ ${TARGET} = *"apple"* ]]; then
|
|
export CARGO_CMD=cargo
|
|
export JEMALLOC_SYS_VERIFY_CONFIGURE=1
|
|
else
|
|
cargo install cross
|
|
docker build -t jemallocator/${TARGET}:0.1 ci/docker/${TARGET}
|
|
fi
|
|
|
|
# Make sure TARGET is installed when using cargo:
|
|
if [[ ${CARGO_CMD} == "cargo" ]]; then
|
|
rustup target add ${TARGET} || true
|
|
fi
|
|
|
|
${CARGO_CMD} build -vv --target $TARGET
|
|
${CARGO_CMD} build -vv --target $TARGET --features profiling
|
|
${CARGO_CMD} build -vv --target $TARGET --features debug
|
|
${CARGO_CMD} build -vv --target $TARGET --features 'debug profiling'
|
|
${CARGO_CMD} test -vv --target $TARGET
|
|
${CARGO_CMD} test -vv --target $TARGET --release
|