1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-26 18:01:35 +01:00

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

@@ -599,7 +599,7 @@ void UnityConcludeTest(void)
Unity.CurrentTestFailed = 0;
Unity.CurrentTestIgnored = 0;
UNITY_EXEC_TIME_RESET();
UNITY_PRINT_EXEC_TIME();
UNITY_PRINT_EOL();
UNITY_FLUSH_CALL();
}
@@ -1589,6 +1589,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
Unity.CurrentTestLineNumber = (UNITY_LINE_TYPE)FuncLineNum;
Unity.NumberOfTests++;
UNITY_CLR_DETAILS();
UNITY_EXEC_TIME_START();
if (TEST_PROTECT())
{
setUp();
@@ -1598,6 +1599,7 @@ void UnityDefaultTestRun(UnityTestFunction Func, const char* FuncName, const int
{
tearDown();
}
UNITY_EXEC_TIME_STOP();
UnityConcludeTest();
}
@@ -1612,7 +1614,6 @@ void UnityBegin(const char* filename)
Unity.TestIgnores = 0;
Unity.CurrentTestFailed = 0;
Unity.CurrentTestIgnored = 0;
UNITY_EXEC_TIME_RESET();
UNITY_CLR_DETAILS();
UNITY_OUTPUT_START();