Improvements to the execution time feature

- Running time macros have been made more portable, previously it was not
  possible to override all macros
- Running time macros will be executed by default test runner, and auto test
  runners
- Adds a default execution time implementation for unix. (Previous default
  implementation only worked on Windows)
- For embedded platforms there is a simple method of getting a default
  implementation by defining a single macro UNITY_CLOCK_MS()
- Removed need for UNITY_EXEC_TIME_RESET. This was not being used for the default
  implementations, if anything ever did need reset-like functionality it could
  simply be wrapped up with the start or stop macros for that platform
This commit is contained in:
elliot
2018-12-01 21:43:49 +00:00
committed by Elliot Gawthrop
parent 9ef1088eb7
commit 076f0fff56
4 changed files with 59 additions and 41 deletions

View File

@ -299,6 +299,7 @@ class UnityTestRunnerGenerator
output.puts(' Unity.CurrentTestLineNumber = TestLineNum; \\')
output.puts(' if (UnityTestMatches()) { \\') if @options[:cmdline_args]
output.puts(' Unity.NumberOfTests++; \\')
output.puts(' UNITY_EXEC_TIME_START(); \\')
output.puts(' CMock_Init(); \\') unless used_mocks.empty?
output.puts(' UNITY_CLR_DETAILS(); \\') unless used_mocks.empty?
output.puts(' if (TEST_PROTECT()) \\')
@ -315,6 +316,7 @@ class UnityTestRunnerGenerator
output.puts(' CMock_Verify(); \\') unless used_mocks.empty?
output.puts(' } \\')
output.puts(' CMock_Destroy(); \\') unless used_mocks.empty?
output.puts(' UNITY_EXEC_TIME_STOP(); \\')
output.puts(' UnityConcludeTest(); \\')
output.puts(' } \\') if @options[:cmdline_args]
output.puts("}\n")