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
Test Double (an alternative to CppUMock) #1199
base: master
Are you sure you want to change the base?
Conversation
…at (only doubles)
Shuffling is off by default. -s enables shuffling with random seed derived from current time. The seed is printed before executing tests. A specific test execution order can be reproduced by setting the seed explicitly with -s <seed>. Seed values 0 and 1 are reserved values and cannot be set. If -v (verbose) is enabled, the seed is also printed after test execution. This might be useful in case tests produce console output which could cause the seed printed at the beginning to be lost. Test order is reshuffled between repeats (-r). Co-authored-by: Risto-Matti Vuonnala <rivuonna@nokia.com>
- Use defines for reserved values of random seed - Removed some redundant unit tests - Remove use of C++ standard library headers: -- Implement own shuffle algorithm instead of using random_shuffle from <algorithm> -- Use dynamic array instead of vector from <vector> - Implement and use AtoU to parse unsigned integers from strings - Remove dead code from TestResult - Better unit test coverage Also other improvements: - Randomizer seed is printed on the same line as the test result summary - Document the shuffling feature in the manual
…tion in VisualCppTimeInMillis due to absence of timeGetTime() API in UWP (TIMERR_NOERROR can be used to detect presence of timeGetTime() API).
Remove output parameter from AtoU. As a consequence, seed value 0 (-s 0) is now treated as an invalid command line parameter. It was redundant anyway, because value 0, i.e., "shuffle disabled" is the default when -s is not given. Also cover rand_() in unit tests.
hmm, nullptr was standardized in C++11 but yet this harness requires C++03 compatibility. whats the path forward? |
I'm still not sure why this pull request, but I'll have a look at it at a later time. We will keep compatibility as the unit test framework is frequently used in embedded systems and they often use old compilers. |
modified: tests/CppUTestExt/TestDoubleTest.cpp
As far as I can tell, nullptr is now also a compiler intrinsic that can't be decoupled from the compiler. As well, this test harness's use of CLANG's opinion to deprecate implicit class methods seems like an attempt to redefine C++ in a way that is no longer compatible with the C++11 standard nor code written to C++ standards before C++11. I'd like to pass the gauntlet harness, but I have no idea of which syntax is required. Has the harness been tuned to ignore opinions about cpputest/master? |
Gauntlet harness? |
By "gauntlet harness" I mean the set of test harnesses to validate pull requests (travis, coveralls, appveyor) |
Ok. It isn't tuned ? |
By "tuned" I mean does it ignore some errors that would have been generated by standard CppUTest code (i.e. 0 vs nullptr initialization of pointers). |
I'm not 100% sure, it should be in the CMake and autotools files. |
What do you think about Test Double design? |
I'm yet to discover why :) If I have more time, I'll browse through the code. |
see README_TestDouble.md for rationale and design.