Skip to content

Commit

Permalink
Merge pull request #278 from otiai10/develop
Browse files Browse the repository at this point in the history
Fix docker test of the root file
  • Loading branch information
otiai10 authored Jun 23, 2023
2 parents afa0cf0 + 87a749b commit 7bc6b8d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get install -y -qq libtesseract-dev libleptonica-dev

# In case you face TESSDATA_PREFIX error, you minght need to set env vars
# to specify the directory where "tessdata" is located.
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata/
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/5/tessdata/

# Load languages.
# These {lang}.traineddata would b located under ${TESSDATA_PREFIX}/tessdata.
Expand Down
24 changes: 24 additions & 0 deletions test/runtime
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Options:
--run|-R {case} Run only cases which have specified pattern in the case names.
--exclude|-X {case} Run only cases which DON'T have specified pattern in the case names.
--rm Remove VMs which are created by this runtime test.
--list|-l Just list runtimes
--help|-h Show this message ;)
Examples:
Expand All @@ -51,6 +52,7 @@ function parse_options() {
QUIET=
MATCH=
EXCLUDE=
LIST=
while [[ $# -gt 0 ]]; do
case "${1}" in
--driver|-d)
Expand Down Expand Up @@ -85,6 +87,10 @@ function parse_options() {
EXCLUDE="${2}"
shift && shift
;;
--list|-l)
LIST=YES
shift
;;
--help|-h)
help && exit 0
;;
Expand All @@ -100,6 +106,15 @@ function parse_options() {

# {{{ Runner function for "--driver docker"
function test_docker_runtimes() {
if [ -n "${LIST}" ]; then
echo "Available runtimes (docker):"
for runtime in `ls ${PROJDIR}/test/runtimes/*.Dockerfile`; do
testcase=`basename ${runtime} | sed -e s/\.Dockerfile$//`
echo " ${testcase}"
done
return 0
fi

for runtime in `ls ${PROJDIR}/test/runtimes/*.Dockerfile`; do
testcase=`basename ${runtime} | sed -e s/\.Dockerfile$//`
if [ -n "${MATCH}" ]; then
Expand Down Expand Up @@ -144,6 +159,15 @@ function test_docker_runtimes() {

# {{{ Runner function for "--driver vagrant"
function test_vagrant_runtimes() {
if [ -n "${LIST}" ]; then
echo "Available runtimes (vagrant):"
for runtime in `ls ${PROJDIR}/test/runtimes/*.Vagrantfile`; do
testcase=`basename ${runtime} | sed -e s/\.Vagrantfile$//`
echo " ${testcase}"
done
return 0
fi

for runtime in `ls ${PROJDIR}/test/runtimes/*.Vagrantfile`; do
testcase=`basename ${runtime} | sed -e s/\.Vagrantfile$//`
if [ -n "${MATCH}" ]; then
Expand Down

0 comments on commit 7bc6b8d

Please sign in to comment.