diff options
| author | rimio <vasi.vilvoiu@gmail.com> | 2018-03-02 01:42:43 +0200 |
|---|---|---|
| committer | rimio <vasi.vilvoiu@gmail.com> | 2018-03-03 01:39:53 +0200 |
| commit | d31766d827c085dea004ebf7209ab45eddaad02b (patch) | |
| tree | c52e09cbf927f4d59eadff04510e84c6a630c86f /test/runtests.sh | |
| parent | f2397db2cab21c9db06e8f7b69981f7eb2ca8cd5 (diff) | |
Various fixes and refactoring.
Diffstat (limited to 'test/runtests.sh')
| -rwxr-xr-x | test/runtests.sh | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/test/runtests.sh b/test/runtests.sh index 96de614..29569d7 100755 --- a/test/runtests.sh +++ b/test/runtests.sh @@ -20,21 +20,26 @@ echo "============================== APPENDIX A ==============================" for f in files/appendix_a/*.bin; do answer_file=${f%.bin}.answer result_file=${f%.bin}.result - - ../bin/ecbor-describe $f > $result_file 2>/dev/null - rc=$? - - if [ ! -f $result_file ] || [ ! -f $answer_file ] || [ "$(diff $answer_file $result_file 2>/dev/null)" != "" ]; then - fail=$(($fail + 1)) - status=$FAIL_MSG - else - pass=$(($pass + 1)) - status=$PASS_MSG - fi - - machine_indented=$(printf '%-67s' "$f") - machine_indented=${machine_indented// /.} - printf "%s %s\n" "$machine_indented" "$status" + + declare -a opts=("" "--tree") + + for opt in "${opts[@]}"; do + ../bin/ecbor-describe $opt $f > $result_file 2>/dev/null + rc=$? + + if [ ! -f $result_file ] || [ ! -f $answer_file ] || [ "$(diff $answer_file $result_file 2>/dev/null)" != "" ]; then + fail=$(($fail + 1)) + status=$FAIL_MSG + else + pass=$(($pass + 1)) + status=$PASS_MSG + fi + + test_name="$f($opt)" + machine_indented=$(printf '%-67s' "$test_name") + machine_indented=${machine_indented// /.} + printf "%s %s\n" "$machine_indented" "$status" + done done echo "========================================================================" echo "Passed / Failed: ${pass}/${fail}" |
