tesseract v5.3.3.20231005
tesseract::QuickTest Class Reference
Inheritance diagram for tesseract::QuickTest:
testing::Test testing::Test testing::Test tesseract::EuroText tesseract::LoadLang tesseract::LoadLanguage tesseract::LoadScript tesseract::MatchGroundTruth

Protected Member Functions

void SetUp () override
 
void TearDown () override
 
void SetUp () override
 
void TearDown () override
 
void SetUp () override
 
void TearDown () override
 
- Protected Member Functions inherited from testing::Test
 Test ()
 
virtual void SetUp ()
 
virtual void TearDown ()
 

Protected Attributes

time_t start_time_
 

Additional Inherited Members

- Public Member Functions inherited from testing::Test
virtual ~Test ()
 
- Static Public Member Functions inherited from testing::Test
static void SetUpTestSuite ()
 
static void TearDownTestSuite ()
 
static void TearDownTestCase ()
 
static void SetUpTestCase ()
 
static bool HasFatalFailure ()
 
static bool HasNonfatalFailure ()
 
static bool IsSkipped ()
 
static bool HasFailure ()
 
static void RecordProperty (const std::string &key, const std::string &value)
 
static void RecordProperty (const std::string &key, int value)
 

Detailed Description

Definition at line 38 of file apiexample_test.cc.

Member Function Documentation

◆ SetUp() [1/3]

void tesseract::QuickTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 40 of file apiexample_test.cc.

40 {
41 start_time_ = time(nullptr);
42 }

◆ SetUp() [2/3]

void tesseract::QuickTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 28 of file loadlang_test.cc.

28 {
29 start_time_ = time(nullptr);
30 }

◆ SetUp() [3/3]

void tesseract::QuickTest::SetUp ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 40 of file progress_test.cc.

40 {
41 start_time_ = time(nullptr);
42 }

◆ TearDown() [1/3]

void tesseract::QuickTest::TearDown ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 43 of file apiexample_test.cc.

43 {
44#ifndef NDEBUG
45 // Debug builds can be very slow, so allow 4 min for OCR of a test image.
46 // apitest_example including disabled tests takes about 18 min on ARMv7.
47 const time_t MAX_SECONDS_FOR_TEST = 240;
48#else
49 // Release builds typically need less than 10 s for OCR of a test image,
50 // apitest_example including disabled tests takes about 90 s on ARMv7.
51 const time_t MAX_SECONDS_FOR_TEST = 55;
52#endif
53 const time_t end_time = time(nullptr);
54 EXPECT_TRUE(end_time - start_time_ <= MAX_SECONDS_FOR_TEST)
55 << "The test took too long - " << ::testing::PrintToString(end_time - start_time_);
56 }
#define EXPECT_TRUE(condition)
Definition: gtest.h:1982
::std::string PrintToString(const T &value)

◆ TearDown() [2/3]

void tesseract::QuickTest::TearDown ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 31 of file loadlang_test.cc.

31 {
32 const time_t end_time = time(nullptr);
33 EXPECT_TRUE(end_time - start_time_ <= 25)
34 << "The test took too long - " << ::testing::PrintToString(end_time - start_time_);
35 }

◆ TearDown() [3/3]

void tesseract::QuickTest::TearDown ( )
inlineoverrideprotectedvirtual

Reimplemented from testing::Test.

Definition at line 43 of file progress_test.cc.

43 {
44 const time_t end_time = time(nullptr);
45 EXPECT_TRUE(end_time - start_time_ <= 25)
46 << "The test took too long - " << ::testing::PrintToString(end_time - start_time_);
47 }

Member Data Documentation

◆ start_time_

time_t tesseract::QuickTest::start_time_
protected

Definition at line 57 of file apiexample_test.cc.


The documentation for this class was generated from the following files: