Use 'compiletest' from git.

This commit is contained in:
Sergio Benitez 2018-10-29 01:48:33 -07:00
parent 7971204dc2
commit 0645a50526
2 changed files with 22 additions and 11 deletions

View File

@ -19,7 +19,7 @@ rocket = { version = "0.3.17", path = "../lib/" }
log = "0.3"
[dev-dependencies]
compiletest_rs = { version = "0.3", features = ["stable"] }
compiletest_rs = { git = "https://github.com/laumann/compiletest-rs" }
[build-dependencies]
yansi = "0.4"

View File

@ -2,7 +2,7 @@
set -e
#
# Publishes the current versions of core, contrib, and codegen to crates.io.
# Publishes the current versions of all Rocket crates to crates.io.
#
# Brings in: ROOT_DIR, EXAMPLES_DIR, LIB_DIR, CODEGEN_DIR, CONTRIB_DIR, DOC_DIR
@ -14,17 +14,25 @@ if ! [ -z "$(git status --porcelain)" ]; then
exit 1
fi
function strip_dev_dependencies() {
perl -i.bak -p0e 's/\[dev-dependencies\][^\[]*//smg' "${1}/Cargo.toml"
}
function restore_dev_dependencies() {
mv "${1}/Cargo.toml.bak" "${1}/Cargo.toml"
}
# Ensure everything passes before trying to publish.
echo ":::: Running test suite [debug]..."
echo ":::: Running test suite..."
cargo clean
bash "${SCRIPT_DIR}/test.sh"
bash "${SCRIPT_DIR}/test.sh --release"
echo ":::: Running test suite [release]..."
cargo clean
bash "${SCRIPT_DIR}/test.sh" --release
# Temporarily remove the dependency on codegen from core so crates.io verifies.
sed -i.bak 's/rocket_codegen.*//' "${LIB_DIR}/Cargo.toml"
# Temporarily remove dev-dependencies so crates.io verifies.
echo ":::: Stripping [dev-dependencies]..."
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
strip_dev_dependencies "${dir}"
done
# Publish all the things.
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
@ -35,5 +43,8 @@ for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
popd
done
# Restore the original core Cargo.toml.
mv "${LIB_DIR}/Cargo.toml.bak" "${LIB_DIR}/Cargo.toml"
# Restore dev-dependencies.
echo ":::: Restoring [dev-dependencies]..."
for dir in "${LIB_DIR}" "${CODEGEN_DIR}" "${CONTRIB_DIR}"; do
restore_dev_dependencies "${dir}"
done