2018-05-02 14:06:16 +00:00
|
|
|
#!/usr/bin/env sh
|
2018-05-02 09:33:27 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-05-02 11:56:26 +00:00
|
|
|
# Runs jemalloc tests using "make check":
|
2018-05-02 12:07:55 +00:00
|
|
|
#export JEMALLOC_SYS_RUN_TESTS=1
|
2018-05-02 09:33:27 +00:00
|
|
|
|
|
|
|
# Use cargo on native CI platforms:
|
2018-05-02 15:18:59 +00:00
|
|
|
if [[ ${TARGET} = *"windows"* ]] || \
|
|
|
|
[[ ${TARGET} = *"x86_64-unknown-linux-gnu"* ]] || [[ ${TARGET} = *"i686-unknown-linux-gnu"* ]] || [[ ${TARGET} = *"i586-unknown-linux-gnu"* ]] \
|
|
|
|
|| [[ ${TARGET} = *"apple"* ]]; then
|
2018-05-02 09:33:27 +00:00
|
|
|
export CARGO_CMD=cargo
|
|
|
|
else
|
2018-05-03 16:23:38 +00:00
|
|
|
cargo install cross || echo "cross is already installed"
|
2018-05-02 09:33:27 +00:00
|
|
|
fi
|
|
|
|
|
2018-05-03 17:06:19 +00:00
|
|
|
if [[ ${TARGET} = *"x86_64-unknown-linux-gnu"* ]]; then
|
|
|
|
export JEMALLOC_SYS_VERIFY_CONFIGURE=1
|
|
|
|
fi
|
|
|
|
|
2018-05-02 09:33:27 +00:00
|
|
|
# Make sure TARGET is installed when using cargo:
|
|
|
|
if [[ ${CARGO_CMD} == "cargo" ]]; then
|
|
|
|
rustup target add ${TARGET} || true
|
|
|
|
fi
|
|
|
|
|
2018-05-02 11:56:26 +00:00
|
|
|
${CARGO_CMD} build -vv --target $TARGET
|
2018-06-13 14:45:11 +00:00
|
|
|
${CARGO_CMD} build -vv --target $TARGET --features alloc_trait
|
2018-05-02 11:56:26 +00:00
|
|
|
${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
|
2018-06-25 07:43:35 +00:00
|
|
|
${CARGO_CMD} test -vv --target $TARGET --features unprefixed_malloc_on_supported_platforms
|
2018-05-02 11:56:26 +00:00
|
|
|
${CARGO_CMD} test -vv --target $TARGET --release
|
2018-07-11 12:50:43 +00:00
|
|
|
# FIXME: something broke in the toolchain leading to these
|
|
|
|
# two commands producing a stack overflow inside of cargo:
|
|
|
|
# https://github.com/alexcrichton/jemallocator/issues/61
|
|
|
|
#${CARGO_CMD} test -vv --target $TARGET -p jemalloc-sys
|
|
|
|
#${CARGO_CMD} test -vv --target $TARGET -p jemalloc-sys --features unprefixed_malloc_on_supported_platforms
|