mirror of https://github.com/rwf2/Rocket.git
Support cargo '+' flags in testing script.
This commit is contained in:
parent
67efe143c5
commit
4a1a4c0e45
|
@ -76,23 +76,27 @@ ALL_PROJECT_DIRS=(
|
|||
"${CONTRIB_LIB_ROOT}"
|
||||
)
|
||||
|
||||
function print_environment() {
|
||||
echo " ROCKET_VERSION: ${ROCKET_VERSION}"
|
||||
echo " CURRENT_RELEASE: ${CURRENT_RELEASE}"
|
||||
echo " PRE_RELEASE: ${PRE_RELEASE}"
|
||||
echo " VERSION_CODENAME: ${VERSION_CODENAME}"
|
||||
echo " SCRIPT_DIR: ${SCRIPT_DIR}"
|
||||
echo " PROJECT_ROOT: ${PROJECT_ROOT}"
|
||||
echo " CORE_ROOT: ${CORE_ROOT}"
|
||||
echo " CONTRIB_ROOT: ${CONTRIB_ROOT}"
|
||||
echo " SITE_ROOT: ${SITE_ROOT}"
|
||||
echo " CORE_LIB_ROOT: ${CORE_LIB_ROOT}"
|
||||
echo " CORE_CODEGEN_ROOT: ${CORE_CODEGEN_ROOT}"
|
||||
echo " CORE_HTTP_ROOT: ${CORE_HTTP_ROOT}"
|
||||
echo " CONTRIB_LIB_ROOT: ${CONTRIB_LIB_ROOT}"
|
||||
echo " CONTRIB_CODEGEN_ROOT: ${CONTRIB_CODEGEN_ROOT}"
|
||||
echo " EXAMPLES_DIR: ${EXAMPLES_DIR}"
|
||||
echo " DOC_DIR: ${DOC_DIR}"
|
||||
echo " ALL_PROJECT_DIRS: ${ALL_PROJECT_DIRS[*]}"
|
||||
echo " date(): $(future_date)"
|
||||
}
|
||||
|
||||
if [ "${1}" = "-p" ]; then
|
||||
echo "ROCKET_VERSION: ${ROCKET_VERSION}"
|
||||
echo "CURRENT_RELEASE: ${CURRENT_RELEASE}"
|
||||
echo "PRE_RELEASE: ${PRE_RELEASE}"
|
||||
echo "VERSION_CODENAME: ${VERSION_CODENAME}"
|
||||
echo "SCRIPT_DIR: ${SCRIPT_DIR}"
|
||||
echo "PROJECT_ROOT: ${PROJECT_ROOT}"
|
||||
echo "CORE_ROOT: ${CORE_ROOT}"
|
||||
echo "CONTRIB_ROOT: ${CONTRIB_ROOT}"
|
||||
echo "SITE_ROOT: ${SITE_ROOT}"
|
||||
echo "CORE_LIB_ROOT: ${CORE_LIB_ROOT}"
|
||||
echo "CORE_CODEGEN_ROOT: ${CORE_CODEGEN_ROOT}"
|
||||
echo "CORE_HTTP_ROOT: ${CORE_HTTP_ROOT}"
|
||||
echo "CONTRIB_LIB_ROOT: ${CONTRIB_LIB_ROOT}"
|
||||
echo "CONTRIB_CODEGEN_ROOT: ${CONTRIB_CODEGEN_ROOT}"
|
||||
echo "EXAMPLES_DIR: ${EXAMPLES_DIR}"
|
||||
echo "DOC_DIR: ${DOC_DIR}"
|
||||
echo "ALL_PROJECT_DIRS: ${ALL_PROJECT_DIRS[*]}"
|
||||
echo "date(): $(future_date)"
|
||||
print_environment
|
||||
fi
|
||||
|
|
|
@ -7,6 +7,8 @@ source "${SCRIPT_DIR}/config.sh"
|
|||
|
||||
# Add Cargo to PATH.
|
||||
export PATH=${HOME}/.cargo/bin:${PATH}
|
||||
export CARGO_INCREMENTAL=0
|
||||
CARGO="cargo"
|
||||
|
||||
# Checks that the versions for Cargo projects $@ all match
|
||||
function check_versions_match() {
|
||||
|
@ -49,6 +51,15 @@ function ensure_trailing_whitespace_free() {
|
|||
fi
|
||||
}
|
||||
|
||||
if [[ $1 == +* ]]; then
|
||||
CARGO="$CARGO $1"
|
||||
shift
|
||||
fi
|
||||
|
||||
echo ":: Preparing. Environment is..."
|
||||
print_environment
|
||||
echo " CARGO: $CARGO"
|
||||
|
||||
echo ":: Ensuring all crate versions match..."
|
||||
check_versions_match "${ALL_PROJECT_DIRS[@]}"
|
||||
|
||||
|
@ -59,7 +70,7 @@ echo ":: Checking for trailing whitespace..."
|
|||
ensure_trailing_whitespace_free
|
||||
|
||||
echo ":: Updating dependencies..."
|
||||
cargo update
|
||||
$CARGO update
|
||||
|
||||
if [ "$1" = "--contrib" ]; then
|
||||
FEATURES=(
|
||||
|
@ -83,11 +94,11 @@ if [ "$1" = "--contrib" ]; then
|
|||
pushd "${CONTRIB_LIB_ROOT}" > /dev/null 2>&1
|
||||
|
||||
echo ":: Building and testing contrib [default]..."
|
||||
CARGO_INCREMENTAL=0 cargo test
|
||||
$CARGO test
|
||||
|
||||
for feature in "${FEATURES[@]}"; do
|
||||
echo ":: Building and testing contrib [${feature}]..."
|
||||
CARGO_INCREMENTAL=0 cargo test --no-default-features --features "${feature}"
|
||||
$CARGO test --no-default-features --features "${feature}"
|
||||
done
|
||||
|
||||
popd > /dev/null 2>&1
|
||||
|
@ -100,16 +111,16 @@ elif [ "$1" = "--core" ]; then
|
|||
pushd "${CORE_LIB_ROOT}" > /dev/null 2>&1
|
||||
|
||||
echo ":: Building and testing core [no features]..."
|
||||
CARGO_INCREMENTAL=0 cargo test --no-default-features
|
||||
$CARGO test --no-default-features
|
||||
|
||||
for feature in "${FEATURES[@]}"; do
|
||||
echo ":: Building and testing core [${feature}]..."
|
||||
|
||||
CARGO_INCREMENTAL=0 cargo test --no-default-features --features "${feature}"
|
||||
$CARGO test --no-default-features --features "${feature}"
|
||||
done
|
||||
|
||||
popd > /dev/null 2>&1
|
||||
else
|
||||
echo ":: Building and testing libraries..."
|
||||
CARGO_INCREMENTAL=0 cargo test --all-features --all $@
|
||||
$CARGO test --all-features --all $@
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue