summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/error_cases/incomplete/incomplete_array_000.answer1
-rw-r--r--test/files/error_cases/incomplete/incomplete_array_000.hex1
-rwxr-xr-xtest/runtests.sh34
3 files changed, 29 insertions, 7 deletions
diff --git a/test/files/error_cases/incomplete/incomplete_array_000.answer b/test/files/error_cases/incomplete/incomplete_array_000.answer
new file mode 100644
index 0000000..de29525
--- /dev/null
+++ b/test/files/error_cases/incomplete/incomplete_array_000.answer
@@ -0,0 +1 @@
+ECBOR error 50
diff --git a/test/files/error_cases/incomplete/incomplete_array_000.hex b/test/files/error_cases/incomplete/incomplete_array_000.hex
new file mode 100644
index 0000000..1208ab6
--- /dev/null
+++ b/test/files/error_cases/incomplete/incomplete_array_000.hex
@@ -0,0 +1 @@
+830102 \ No newline at end of file
diff --git a/test/runtests.sh b/test/runtests.sh
index 29569d7..8c631f4 100755
--- a/test/runtests.sh
+++ b/test/runtests.sh
@@ -11,13 +11,8 @@ FAIL_MSG=$(echo -e "\033[0;31mFAIL\033[0m")
total_pass=0
total_fail=0
-# Run Appendix A tests
-pass=0
-fail=0
-
-echo ""
-echo "============================== APPENDIX A =============================="
-for f in files/appendix_a/*.bin; do
+run_test() {
+ f=$1
answer_file=${f%.bin}.answer
result_file=${f%.bin}.result
@@ -40,6 +35,31 @@ for f in files/appendix_a/*.bin; do
machine_indented=${machine_indented// /.}
printf "%s %s\n" "$machine_indented" "$status"
done
+}
+
+# Appendix A tests
+pass=0
+fail=0
+
+echo ""
+echo "============================== APPENDIX A =============================="
+for f in files/appendix_a/*.bin; do
+ run_test $f
+done
+echo "========================================================================"
+echo "Passed / Failed: ${pass}/${fail}"
+
+total_pass=$(($total_pass + $pass))
+total_fail=$(($total_fail + $fail))
+
+# Error cases tests
+pass=0
+fail=0
+
+echo ""
+echo "============================== ERROR CASE =============================="
+for f in files/error_cases/incomplete/*.bin; do
+ run_test $f
done
echo "========================================================================"
echo "Passed / Failed: ${pass}/${fail}"