bdk-ffi/test.sh

45 lines
778 B
Bash
Raw Normal View History

2021-06-14 22:38:29 -07:00
#!/usr/bin/env bash
2021-09-25 21:17:40 -07:00
set -eo pipefail
# functions
## help
help()
{
# Display Help
echo "Test bdk-uniffi and related libraries."
2021-09-25 21:17:40 -07:00
echo
echo "Syntax: build [-a|h|k|v]"
echo "options:"
echo "-a Android connected device tests."
2021-09-25 21:17:40 -07:00
echo "-h Print this Help."
echo "-k Kotlin tests."
2021-09-25 21:17:40 -07:00
echo
}
2021-06-14 22:38:29 -07:00
2021-09-25 21:17:40 -07:00
test_kotlin() {
(cd bindings/bdk-kotlin && ./gradlew :jvm:test -Djna.debug_load=true)
}
test_android() {
(cd bindings/bdk-kotlin && ./gradlew :android:connectedDebugAndroidTest)
2021-09-25 21:17:40 -07:00
}
2021-06-14 22:38:29 -07:00
2021-09-25 21:17:40 -07:00
if [ $1 = "-h" ]
then
help
else
cargo test
2021-10-14 00:06:05 +05:30
2021-09-25 21:17:40 -07:00
# optional tests
while [ -n "$1" ]; do # while loop starts
2021-10-14 00:06:05 +05:30
case "$1" in
-a) test_android ;;
2021-09-25 21:17:40 -07:00
-h) help ;;
-k) test_kotlin ;;
*) echo "Option $1 not recognized" ;;
esac
shift
done
2021-10-14 00:06:05 +05:30
fi