opencv/modules/core/test
Ryan Wong 8af96248bf Merge pull request #13909 from kinchungwong:logging_20190220
OE-11 Logging revamp (#13909)

* Initial commit for log tag support.

Part of #11003, incomplete. Should pass build.

Moved LogLevel enum to logger.defines.hpp

LogTag struct used to convey both name and log level threshold as
one argument to the new logging macro. See logtag.hpp file, and
CV_LOG_WITH_TAG macro.

Global log level is now associated with a global log tag, when a
logging statement doesn't specify any log tag. See getLogLevel and
getGlobalLogTag functions.

A macro CV_LOGTAG_FALLBACK is allowed to be re-defined by other modules
or compilation units, internally, so that logging statements inside
that unit that specify NULL as tag will fall back to the re-defined tag.

Line-of-code information (file name, line number, function name),
together with tag name, are passed into the new log message sink.
See writeLogMessageEx function.

Fixed old incorrect CV_LOG_VERBOSE usage in ocl4dnn_conv_spatial.cpp.

* Implemented tag-based log filtering

Added LogTagManager. This is an initial version, using standard C++
approach as much as possible, to allow easier code review. Will
optimize later.

A workaround for all static dynamic initialization issues is
implemented. Refer to code comments.

* Added LogTagConfigParser.

Note: new code does not fully handle old log config parsing behavior.

* Fix log tag config vs registering ordering issue.

* Started testing LogTagConfigParser, incomplete.

The intention of this commit is to illustrate the capabilities of
the current design of LogTagConfigParser.

The test contained in this commit is not complete. Also, design changes
may require throwing away this commit and rewriting test code from
scratch.

Does not test whitespace segmentation (multiple tags on the config);
will do in next commit.

* Added CV_LOGTAG_EXPAND_NAME macro

This macro allows to be re-defined locally in other compilation units
to apply a prefix to whatever argument is passed as the "tag" argument
into CV_LOG_WITH_TAG. The default definition in logger.hpp does not
modify the argument. It is recommended to include the address-of
operator (ampersand) when re-defined locally.

* Added a few tests for LogTagManager, some fail.

See test_logtagmanager.cpp
Failed tests are: non-global ("something"), setting level by name-part
(first part or any part) has no effect at all.

* LogTagManagerTests substring non-confusion tests

* Fix major bugs in LogTagManager

The code change is intended to approximate the spec documented in
https://gist.github.com/kinchungwong/ec25bc1eba99142e0be4509b0f67d0c6

Refer to test suite in test_logtagmanager.cpp

Filter test result in "opencv_test_core" ...
with gtest_filter "LogTagManager*"

To see the test code that finds the bugs, refer to original commits
(before rebase; might be gone)

.. f3451208 (2019-03-03T19:45:17Z)
.... LogTagManagerTests substring non-confusion tests

.. 1b848f5f (2019-03-03T01:55:18Z)
.... Added a few tests for LogTagManager, some fail.

* Added LogTagManagerNamePartNonConfusionTest.

See test_logtagmanager.cpp in modules/core/test.

* Added LogTagAuto for auto registration in ctor

* Rewritten LogTagManager to resolve issues.

* Resolves code review issues around 2019-04-10

LogTagConfigParser::parseLogLevel - as part of resolving code review
issues, this function is rewritten to simplify control flow and to
improve conformance with legacy usage (for string values "OFF",
"DISABLED", and "WARNINGS").
2019-04-22 00:01:10 +03:00
..
ocl Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-09-28 14:14:47 +03:00
test_arithm.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2018-11-12 17:58:45 +03:00
test_concatenation.cpp Added more strict checks for empty inputs to compare, meanStdDev and RNG::fill 2018-07-26 18:06:38 +03:00
test_conjugate_gradient.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_countnonzero.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_downhill_simplex.cpp Misc. modules/ typos 2018-02-12 07:09:43 -05:00
test_ds.cpp completely new C++ persistence implementation (#13011) 2018-11-02 00:27:06 +03:00
test_dxt.cpp Utilize CV_UNUSED macro 2018-09-07 20:33:52 +09:00
test_eigen.cpp core: fix Core_EigenNonSymmetric.convergence test 2019-03-19 15:18:43 +03:00
test_hal_core.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_intrin128.simd.hpp core(test): intrinsic tests for all dispatched CPU optimizations 2018-08-01 13:50:42 +03:00
test_intrin256.simd.hpp core(test): intrinsic tests for all dispatched CPU optimizations 2018-08-01 13:50:42 +03:00
test_intrin_utils.hpp core: reimplement SIMD arithmetic, logic and comparison operations into wide universal intrinsics 2018-10-30 12:48:31 +02:00
test_intrin.cpp fix build warnings 2018-09-27 16:31:31 +03:00
test_io.cpp Add a test for FileNode::keys() 2018-11-12 13:38:18 +03:00
test_logtagconfigparser.cpp Merge pull request #13909 from kinchungwong:logging_20190220 2019-04-22 00:01:10 +03:00
test_logtagmanager.cpp Merge pull request #13909 from kinchungwong:logging_20190220 2019-04-22 00:01:10 +03:00
test_lpsolver.cpp core: update solveLP() interface 2018-10-15 18:58:11 +00:00
test_main.cpp Merge pull request #11897 from Jakub-Golinowski:hpx_backend 2018-08-31 16:23:26 +03:00
test_mat.cpp Merge remote-tracking branch 'upstream/3.4' into merge-3.4 2019-03-06 11:43:16 +03:00
test_math.cpp Merge pull request #14162 from alalek:eliminate_coverity_scan_issues 2019-03-27 15:48:00 +03:00
test_misc.cpp core: fix condition in OutputArray::create(allowTransposed=True) 2019-03-05 16:26:59 +03:00
test_operations.cpp Added test for addition of Mat and Matx 2018-12-25 19:22:04 +03:00
test_precomp.hpp core(test): intrinsic tests for all dispatched CPU optimizations 2018-08-01 13:50:42 +03:00
test_ptr.cpp Fixed warnings produced by clang-9.0.0 2019-01-30 14:05:32 +03:00
test_rand.cpp Added more strict checks for empty inputs to compare, meanStdDev and RNG::fill 2018-07-26 18:06:38 +03:00
test_rotatedrect.cpp ts: refactor OpenCV tests 2018-02-03 19:39:47 +00:00
test_umat.cpp Misc. modules/ typos 2018-02-12 07:09:43 -05:00
test_utils.cpp core: add utils::findDataFile() / samples::findFile() 2018-11-16 00:25:06 +00:00