diff options
Diffstat (limited to 'dist/ectester.sh')
| -rwxr-xr-x | dist/ectester.sh | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dist/ectester.sh b/dist/ectester.sh new file mode 100755 index 0000000..0de1bc3 --- /dev/null +++ b/dist/ectester.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +dangerous="0" + +positional=() +while [[ $# -gt 0 ]] +do + +key="$1" +case $key in + --dangerous) + dangerous=1 + shift + ;; + *) + positional+=("$1") + shift + ;; +esac +done +set -- "${positional[@]}" + +if [[ $# -ne 1 ]]; then + echo "One argument expected:" >&2 + echo " ./ectester.sh [--dangerous] CARD_NAME" >&2 + exit 1 +fi + +declare -a tests=("default" "test-vectors") +if [[ "$dangerous" == "1" ]]; then + tests+=("invalid" "wrong" "composite") +fi + +declare -a files=() +for i in $(seq 0 $((${#tests[@]} - 1))); do + test="${tests[$i]}" + java -jar ECTester.jar -t ${test} -a --format yaml -l ${1}.${test} + files+=(${1}.$test) +done + +if command -v tar 2>&1 >/dev/null; then + tar -czvf ${1}.tar.gz ${files[*]} +elif command -v zip 2>&1 >/dev/null; then + zip ${1}.zip ${files[*]} +fi
\ No newline at end of file |
