From 7b5f593709250fe10c21902518520ea74e7b3878 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Tue, 7 May 2024 18:33:36 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20a=20simple=20test=20runner=20?= =?UTF-8?q?and=20move=20tests=20to=20subdirectory?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test.sh | 24 +++++++++++++++++++ test-core.sh => tests/test-core.sh | 0 .../test-dinglehopper.sh | 0 test-eynollah.sh => tests/test-eynollah.sh | 0 .../test-ocrd_anybaseocr.sh | 0 .../test-ocrd_calamari.sh | 0 test-ocrd_cis.sh => tests/test-ocrd_cis.sh | 0 .../test-ocrd_fileformat.sh | 0 .../test-ocrd_olena.sh | 0 .../test-ocrd_segment.sh | 0 .../test-ocrd_tesserocr.sh | 0 .../test-ocrd_trocr.sh | 0 test-ocrd_wrap.sh => tests/test-ocrd_wrap.sh | 0 .../test-sbb_binarization.sh | 0 14 files changed, 24 insertions(+) create mode 100755 test.sh rename test-core.sh => tests/test-core.sh (100%) rename test-dinglehopper.sh => tests/test-dinglehopper.sh (100%) rename test-eynollah.sh => tests/test-eynollah.sh (100%) rename test-ocrd_anybaseocr.sh => tests/test-ocrd_anybaseocr.sh (100%) rename test-ocrd_calamari.sh => tests/test-ocrd_calamari.sh (100%) rename test-ocrd_cis.sh => tests/test-ocrd_cis.sh (100%) rename test-ocrd_fileformat.sh => tests/test-ocrd_fileformat.sh (100%) rename test-ocrd_olena.sh => tests/test-ocrd_olena.sh (100%) rename test-ocrd_segment.sh => tests/test-ocrd_segment.sh (100%) rename test-ocrd_tesserocr.sh => tests/test-ocrd_tesserocr.sh (100%) rename test-ocrd_trocr.sh => tests/test-ocrd_trocr.sh (100%) rename test-ocrd_wrap.sh => tests/test-ocrd_wrap.sh (100%) rename test-sbb_binarization.sh => tests/test-sbb_binarization.sh (100%) diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..f588bd6 --- /dev/null +++ b/test.sh @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +count_ok=0 +count_failed=0 + +for test in tests/*.sh; do + echo "== $test" + $test && result=$? || result=$? + + if [[ $result = 0 ]]; then + echo "✔" + count_ok=$((count_ok+1)) + else + echo "❌" + count_failed=$((count_failed+1)) + fi + echo +done + +echo "$count_ok ok, $count_failed failed" +if [[ $count_failed -gt 0 ]]; then + exit 1 +fi diff --git a/test-core.sh b/tests/test-core.sh similarity index 100% rename from test-core.sh rename to tests/test-core.sh diff --git a/test-dinglehopper.sh b/tests/test-dinglehopper.sh similarity index 100% rename from test-dinglehopper.sh rename to tests/test-dinglehopper.sh diff --git a/test-eynollah.sh b/tests/test-eynollah.sh similarity index 100% rename from test-eynollah.sh rename to tests/test-eynollah.sh diff --git a/test-ocrd_anybaseocr.sh b/tests/test-ocrd_anybaseocr.sh similarity index 100% rename from test-ocrd_anybaseocr.sh rename to tests/test-ocrd_anybaseocr.sh diff --git a/test-ocrd_calamari.sh b/tests/test-ocrd_calamari.sh similarity index 100% rename from test-ocrd_calamari.sh rename to tests/test-ocrd_calamari.sh diff --git a/test-ocrd_cis.sh b/tests/test-ocrd_cis.sh similarity index 100% rename from test-ocrd_cis.sh rename to tests/test-ocrd_cis.sh diff --git a/test-ocrd_fileformat.sh b/tests/test-ocrd_fileformat.sh similarity index 100% rename from test-ocrd_fileformat.sh rename to tests/test-ocrd_fileformat.sh diff --git a/test-ocrd_olena.sh b/tests/test-ocrd_olena.sh similarity index 100% rename from test-ocrd_olena.sh rename to tests/test-ocrd_olena.sh diff --git a/test-ocrd_segment.sh b/tests/test-ocrd_segment.sh similarity index 100% rename from test-ocrd_segment.sh rename to tests/test-ocrd_segment.sh diff --git a/test-ocrd_tesserocr.sh b/tests/test-ocrd_tesserocr.sh similarity index 100% rename from test-ocrd_tesserocr.sh rename to tests/test-ocrd_tesserocr.sh diff --git a/test-ocrd_trocr.sh b/tests/test-ocrd_trocr.sh similarity index 100% rename from test-ocrd_trocr.sh rename to tests/test-ocrd_trocr.sh diff --git a/test-ocrd_wrap.sh b/tests/test-ocrd_wrap.sh similarity index 100% rename from test-ocrd_wrap.sh rename to tests/test-ocrd_wrap.sh diff --git a/test-sbb_binarization.sh b/tests/test-sbb_binarization.sh similarity index 100% rename from test-sbb_binarization.sh rename to tests/test-sbb_binarization.sh