-
Notifications
You must be signed in to change notification settings - Fork 4.9k
log_to_callback + unit-tests #5584
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
Conversation
* Travis "Linux - cpp" build is now "Linux - cpp -static" and uses static (non-shared; BUILD_SHARED_LIBS is off) compilation * Added unit-testing mechanism: * Any test-*.cpp (and, in future, test-*.py, etc.) under unit-tests/ is a unit-test * Tests can be nested inside directories * Each test creates its own project (in Visual Studio under Unit-Tests, with same nested structure) and thus its own executable * A script (unit-tests/run-unit-tests.py) runs all unit-tests and exits with status 1 or 0 * Unit-tests can be specifically shared or static * Unit-tests are now run in Travis, in both shared and static builds * BUILD_SHARED_LIBS is now a compiler definition, too * Added rs2::log_to_callback, rs2_log_to_callback, rs2_log_to_callback_cpp * Minimum level can be set for a callback (e.g., warnings and above) * Added RS2_LOG_SEVERITY_ALL, same as _DEBUG, so it's easier to say "log all messages" * Logging to file now flushes immediately after each message (down from every 10 messages) mostly so unit-testing works better) * 21 unit-tests under unit-tests/log/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, I have some questions on the python stuff
| /* Return the number of lines in a file */ | ||
| size_t count_lines( char const* filename ) | ||
| { | ||
| FILE* pFile = fopen( filename, "r" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why like this and not c++ style?
- removed rs2_string and any related functions - rs2_build_log_message -> rs2_get_full_log_message; messages are only built when first called - C-style log callbacks now accept a void* argument - restored original file-flush behavior; unit-tests now flush before checking files - restored original realsense-viewer behavior (no callback logging for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Uh oh!
There was an error while loading. Please reload this page.