Created
August 9, 2016 19:52
-
-
Save colin-kiegel/ea4f13db5b14374c68ed345a2224f990 to your computer and use it in GitHub Desktop.
cargo test -- with arrays of multiple dependency versions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script will loop over arrays of dev-dependencies | |
# | |
# - loops can be nested (not nice but efficient) | |
# - http://doc.crates.io/specifying-dependencies.html | |
CUSTOM_DERIVE_VERSIONS=( | |
"=0.1.0" | |
"0.1" | |
) | |
function main { | |
for v_custom_derive in "${CUSTOM_DERIVE_VERSIONS[@]}"; do | |
dev_dependency custom_derive@${v_custom_derive} | |
# nest loops here | |
run_test | |
# .. | |
done | |
} | |
function dev_dependency { | |
echo "II: Setting dev-dependency for $1" | |
cargo add $1 --dev | |
} | |
function run_test { | |
cargo update # otherwise cargo ignores changed dependencies | |
cargo test | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This work is licensed under CC0