Merge pull request #1681 from Shreeshrii/master

minor changes to unittests
This commit is contained in:
Egor Pugin 2018-06-19 12:38:04 +03:00 committed by GitHub
commit 29f280e470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 4 deletions

2
.gitignore vendored
View File

@ -103,6 +103,8 @@ kernel*.bin
/unittest/matrix_test
/unittest/osd_test
/unittest/tesseracttests
/unittest/progress_test
/unittest/loadlang_test
# generated files from unlvtests
times.txt

View File

@ -69,17 +69,39 @@ class QuickTest : public testing::Test {
TESTING_DIR "/phototest.txt",
TESSDATA_DIR "_fast", GetParam());
}
INSTANTIATE_TEST_CASE_P( EngLatinDevaArabLang, MatchGroundTruth,
::testing::Values("eng", "script/Latin", "script/Devanagari", "script/Arabic") );
TEST_P(MatchGroundTruth, BestPhototestOCR) {
OCRTester(TESTING_DIR "/phototest.tif",
TESTING_DIR "/phototest.txt",
TESSDATA_DIR "_best", GetParam());
}
TEST_P(MatchGroundTruth, TessPhototestOCR) {
OCRTester(TESTING_DIR "/phototest.tif",
TESTING_DIR "/phototest.txt",
TESSDATA_DIR , GetParam());
}
INSTANTIATE_TEST_CASE_P( Eng, MatchGroundTruth,
::testing::Values("eng") );
INSTANTIATE_TEST_CASE_P( Latin, MatchGroundTruth,
::testing::Values("script/Latin") );
INSTANTIATE_TEST_CASE_P( Deva, MatchGroundTruth,
::testing::Values("script/Devanagari") );
INSTANTIATE_TEST_CASE_P( Arab, MatchGroundTruth,
::testing::Values("script/Arabic") );
class EuroText : public QuickTest {
};
TEST_F(EuroText, FastOCR) {
TEST_F(EuroText, FastLatinOCR) {
OCRTester(TESTING_DIR "/eurotext.tif",
TESTING_DIR "/eurotext.txt",
TESSDATA_DIR "_fast", "script/Latin");
}
// script/Latin for eurotext.tif does not match groundtruth
// for tessdata & tessdata_best
// so do not test these here.
} // namespace