Skip to content

Conversation

@maloel
Copy link
Contributor

@maloel maloel commented Jan 5, 2020

  • Fixed openvino test-cases in static (non-shared) builds
  • Fixed some of the warnings repeatedly given (from headers) during compilation
  • 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"
    • 21 unit-tests under unit-tests/log/

maloel added 3 commits January 5, 2020 12:08
* 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/
@maloel maloel requested a review from dorodnic January 5, 2020 10:30
Copy link
Contributor

@dorodnic dorodnic left a 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" );
Copy link
Contributor

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)
Copy link
Contributor

@dorodnic dorodnic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maloel maloel merged commit 769ff8a into IntelRealSense:development Feb 4, 2020
@maloel maloel deleted the log branch February 4, 2020 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants