Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

makefile.am and apiexample_test #1088

Merged
merged 12 commits into from
Sep 5, 2017
Merged

makefile.am and apiexample_test #1088

merged 12 commits into from
Sep 5, 2017

Conversation

Shreeshrii
Copy link
Collaborator

@Shreeshrii Shreeshrii commented Aug 19, 2017

@theraysmith @stweil

Please check unittests after applying this PR.

autoreconf -fiv
git submodule update --init
export TESSDATA_PREFIX=/prefix/to/path/to/tessdata
make check

@Shreeshrii
Copy link
Collaborator Author

Also needs updates to Makefile.am Configure.ac in tesseract dir. Will update PR.

@Shreeshrii
Copy link
Collaborator Author

Making check in unittest
make[1]: Entering directory `/mnt/c/Users/User/shree/tesseract/unittest'
make  libgtest.la libgtest_main.la apiexample_test tesseracttests matrix_test
make[2]: Entering directory `/mnt/c/Users/User/shree/tesseract/unittest'
make[2]: `libgtest.la' is up to date.
make[2]: `libgtest_main.la' is up to date.
make[2]: `apiexample_test' is up to date.
make[2]: `tesseracttests' is up to date.
make[2]: `matrix_test' is up to date.
make[2]: Leaving directory `/mnt/c/Users/User/shree/tesseract/unittest'
make  check-TESTS
make[2]: Entering directory `/mnt/c/Users/User/shree/tesseract/unittest'
make[3]: Entering directory `/mnt/c/Users/User/shree/tesseract/unittest'
PASS: apiexample_test
PASS: tesseracttests
PASS: matrix_test
make[4]: Entering directory `/mnt/c/Users/User/shree/tesseract/unittest'
make[4]: Nothing to be done for `all'.
make[4]: Leaving directory `/mnt/c/Users/User/shree/tesseract/unittest'
============================================================================
Testsuite summary for tesseract 4.00.00dev
============================================================================
# TOTAL: 3
# PASS:  3
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory `/mnt/c/Users/User/shree/tesseract/unittest'
make[2]: Leaving directory `/mnt/c/Users/User/shree/tesseract/unittest'
make[1]: Leaving directory `/mnt/c/Users/User/shree/tesseract/unittest'

as not needed after 
8bb5a89
@stweil
Copy link
Member

stweil commented Sep 2, 2017

The tests require installation of GoogleTest of course. How should we handle the case of missing GoogleTest when a user calls make check? Get GoogleTest automatically? Show some help text? Or accept a failure (current status)?

Copy link
Member

@stweil stweil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go on with unit tests and merge this pull request.

@@ -0,0 +1,62 @@
AUTOMAKE_OPTIONS = subdir-objects

AM_CPPFLAGS += \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all those parts of AM_CPPFLAGS necessary, or did you add them because they might be needed by future tests? Personally I prefer a little different syntax because I think it is easier to maintain:

AM_CPPFLAGS += -DUSE_STD_NAMESPACE -DPANGO_ENABLE_ENGINE
AM_CPPFLAGS += -I$(top_srcdir)/ccmain
AM_CPPFLAGS += -I$(top_srcdir)/api
# ...

@amitdo
Copy link
Collaborator

amitdo commented Sep 2, 2017

GoogleTest is now a directory in our repo (sub repo).

@Shreeshrii
Copy link
Collaborator Author

Are all those parts of AM_CPPFLAGS necessary, or did you add them because they might be needed by future tests? Personally I prefer a little different syntax because I think it is easier to maintain:

Ray had referred to the makefile in training and I copied that section from there. I will change it to one per line.

as per suggestion in #1088 (comment)

Not ALL of these are needed currently.
@stweil
Copy link
Member

stweil commented Sep 3, 2017

GoogleTest is now a directory in our repo (sub repo).

Yes, but the submodule googletest is not fetched automatically. Therefore I'd prefer that make check should at least report the missing submodule and show a help text how to fetch it. The current error message for that case might be confusing for users.

@Shreeshrii
Copy link
Collaborator Author

The following directions work for testing the apiexample.

autoreconf -fiv
git submodule update --init
export TESSDATA_PREFIX=/prefix/to/path/to/tessdata
make check

It is possible to change makefile.am and configure.ac to test for the program using pkg-config - please see https://github.com/google/googletest/blob/master/googletest/docs/Pkgconfig.md#autotools

@zdenop zdenop merged commit f29498f into tesseract-ocr:master Sep 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants