Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
f1873bbc
Commit
f1873bbc
authored
Nov 12, 2013
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf tests: allow to skip performance tests
parent
376993be
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
3 deletions
+27
-3
ts_perf.hpp
modules/ts/include/opencv2/ts/ts_perf.hpp
+3
-0
ts_perf.cpp
modules/ts/src/ts_perf.cpp
+24
-3
No files found.
modules/ts/include/opencv2/ts/ts_perf.hpp
View file @
f1873bbc
...
...
@@ -243,6 +243,7 @@ typedef struct CV_EXPORTS performance_metrics
TERM_TIME
=
1
,
TERM_INTERRUPT
=
2
,
TERM_EXCEPTION
=
3
,
TERM_SKIP_TEST
=
4
,
// there are some limitations and test should be skipped
TERM_UNKNOWN
=
-
1
};
...
...
@@ -279,6 +280,8 @@ public:
static
enum
PERF_STRATEGY
getPerformanceStrategy
();
static
enum
PERF_STRATEGY
setPerformanceStrategy
(
enum
PERF_STRATEGY
strategy
);
class
PerfSkipTestException
:
public
cv
::
Exception
{};
protected
:
virtual
void
PerfTestBody
()
=
0
;
...
...
modules/ts/src/ts_perf.cpp
View file @
f1873bbc
...
...
@@ -1175,7 +1175,14 @@ void TestBase::reportMetrics(bool toJUnitXML)
{
performance_metrics
&
m
=
calcMetrics
();
if
(
m
.
terminationReason
==
performance_metrics
::
TERM_SKIP_TEST
)
{
if
(
toJUnitXML
)
{
RecordProperty
(
"custom_status"
,
"skipped"
);
}
}
else
if
(
toJUnitXML
)
{
RecordProperty
(
"bytesIn"
,
(
int
)
m
.
bytesIn
);
RecordProperty
(
"bytesOut"
,
(
int
)
m
.
bytesOut
);
...
...
@@ -1267,21 +1274,30 @@ void TestBase::SetUp()
void
TestBase
::
TearDown
()
{
if
(
metrics
.
terminationReason
==
performance_metrics
::
TERM_SKIP_TEST
)
{
LOGI
(
"
\t
Test was skipped"
);
GTEST_SUCCEED
()
<<
"Test was skipped"
;
}
else
{
if
(
!
HasFailure
()
&&
!
verified
)
ADD_FAILURE
()
<<
"The test has no sanity checks. There should be at least one check at the end of performance test."
;
validateMetrics
();
if
(
HasFailure
())
reportMetrics
(
false
);
else
{
reportMetrics
(
false
);
return
;
}
}
const
::
testing
::
TestInfo
*
const
test_info
=
::
testing
::
UnitTest
::
GetInstance
()
->
current_test_info
();
const
char
*
type_param
=
test_info
->
type_param
();
const
char
*
value_param
=
test_info
->
value_param
();
if
(
value_param
)
printf
(
"[ VALUE ]
\t
%s
\n
"
,
value_param
),
fflush
(
stdout
);
if
(
type_param
)
printf
(
"[ TYPE ]
\t
%s
\n
"
,
type_param
),
fflush
(
stdout
);
reportMetrics
(
true
);
}
}
std
::
string
TestBase
::
getDataPath
(
const
std
::
string
&
relativePath
)
...
...
@@ -1331,6 +1347,11 @@ void TestBase::RunPerfTestBody()
{
this
->
PerfTestBody
();
}
catch
(
PerfSkipTestException
&
)
{
metrics
.
terminationReason
=
performance_metrics
::
TERM_SKIP_TEST
;
return
;
}
catch
(
PerfEarlyExitException
&
)
{
metrics
.
terminationReason
=
performance_metrics
::
TERM_INTERRUPT
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment