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 for googletest tests #1059

Closed
wants to merge 7 commits into from
Closed

makefile for googletest tests #1059

wants to merge 7 commits into from

Conversation

Shreeshrii
Copy link
Collaborator

@stweil Please review and make any needed changes.

'make' will build the test.
'make runtest' will run the test.

@Shreeshrii
Copy link
Collaborator Author

 make runtest
./tesseracttests
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from TesseractTest
[ RUN      ] TesseractTest.ZeroDummyTestForTesseract
[       OK ] TesseractTest.ZeroDummyTestForTesseract (0 ms)
[ RUN      ] TesseractTest.FirstDummyTestForTesseract
[       OK ] TesseractTest.FirstDummyTestForTesseract (0 ms)
[----------] 2 tests from TesseractTest (1 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (5 ms total)
[  PASSED  ] 2 tests.

@stweil
Copy link
Member

stweil commented Jul 29, 2017

It works, thank you. Nevertheless I suggest to wait with full automake support until Ray has started integrating the first real tests from Google.

@Shreeshrii
Copy link
Collaborator Author

@theraysmith @stweil

I have updated the testing framework to use unittest directory.

root@All-in-1-Touch:/mnt/c/Users/User/shree/tesseract/unittest# make
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -c ../unittest/sample1.cc
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -c ../unittest/sample1_unittest.cc
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -I../googletest/googletest -g -Wall -Wextra -pthread -O2 -std=c++11 -c \
            ../googletest/googletest/src/gtest-all.cc
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -I../googletest/googletest -g -Wall -Wextra -pthread -O2 -std=c++11 -c \
            ../googletest/googletest/src/gtest_main.cc
ar rv gtest_main.a gtest-all.o gtest_main.o
ar: creating gtest_main.a
a - gtest-all.o
a - gtest_main.o
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -lpthread sample1.o sample1_unittest.o gtest_main.a -o sample
1_unittest
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -c ../unittest/tesseracttests.cpp
ar rv gtest.a gtest-all.o
ar: creating gtest.a
a - gtest-all.o
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -lpthread tesseracttests.o gtest.a -o tesseracttests
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -I../ccstruct  -I../ccutil -c ../unittest/matrix_test.cc
g++ -isystem ../googletest/googletest/include  -DUSE_STD_NAMESPACE -g -Wall -Wextra -pthread -O2 -std=c++11 -lpthread -llept -ltesseract matrix_test.o gtest_main.a -o ma
trix_test
root@All-in-1-Touch:/mnt/c/Users/User/shree/tesseract/unittest# make runtest
./sample1_unittest
Running main() from gtest_main.cc
[==========] Running 6 tests from 2 test cases.
[----------] Global test environment set-up.
[----------] 3 tests from FactorialTest
[ RUN      ] FactorialTest.Negative
[       OK ] FactorialTest.Negative (0 ms)
[ RUN      ] FactorialTest.Zero
[       OK ] FactorialTest.Zero (0 ms)
[ RUN      ] FactorialTest.Positive
[       OK ] FactorialTest.Positive (0 ms)
[----------] 3 tests from FactorialTest (1 ms total)

[----------] 3 tests from IsPrimeTest
[ RUN      ] IsPrimeTest.Negative
[       OK ] IsPrimeTest.Negative (0 ms)
[ RUN      ] IsPrimeTest.Trivial
[       OK ] IsPrimeTest.Trivial (0 ms)
[ RUN      ] IsPrimeTest.Positive
[       OK ] IsPrimeTest.Positive (0 ms)
[----------] 3 tests from IsPrimeTest (1 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 2 test cases ran. (3 ms total)
[  PASSED  ] 6 tests.
./tesseracttests
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from TesseractTest
[ RUN      ] TesseractTest.ZeroDummyTestForTesseract
[       OK ] TesseractTest.ZeroDummyTestForTesseract (0 ms)
[ RUN      ] TesseractTest.FirstDummyTestForTesseract
[       OK ] TesseractTest.FirstDummyTestForTesseract (0 ms)
[----------] 2 tests from TesseractTest (1 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran. (2 ms total)
[  PASSED  ] 2 tests.
./matrix_test
Running main() from gtest_main.cc
[==========] Running 4 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 4 tests from MatrixTest
[ RUN      ] MatrixTest.RotatingTranspose_3_1
[       OK ] MatrixTest.RotatingTranspose_3_1 (0 ms)
[ RUN      ] MatrixTest.RotatingTranspose_2_0
[       OK ] MatrixTest.RotatingTranspose_2_0 (0 ms)
[ RUN      ] MatrixTest.RotatingTranspose_1_3
[       OK ] MatrixTest.RotatingTranspose_1_3 (0 ms)
[ RUN      ] MatrixTest.RotatingTranspose_0_2
[       OK ] MatrixTest.RotatingTranspose_0_2 (0 ms)
[----------] 4 tests from MatrixTest (1 ms total)

[----------] Global test environment tear-down
[==========] 4 tests from 1 test case ran. (2 ms total)
[  PASSED  ] 4 tests.
root@All-in-1-Touch:/mnt/c/Users/User/shree/tesseract/unittest#

@theraysmith
Copy link
Contributor

theraysmith commented Aug 18, 2017 via email

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.

3 participants