aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2018-07-18 08:03:17 -0400
committerJuergen Haug2018-07-18 08:03:17 -0400
commit5dfd44073e44459aef3c3c1edc7bc1b6e1f9957e (patch)
treec5ae610c19434a826ebf8d699a081ac62db17b2c
parent1a649d5a53f412f0f7d114c31049f62917eafc4a (diff)
downloadorg.eclipse.etrice-5dfd44073e44459aef3c3c1edc7bc1b6e1f9957e.tar.gz
org.eclipse.etrice-5dfd44073e44459aef3c3c1edc7bc1b6e1f9957e.tar.xz
org.eclipse.etrice-5dfd44073e44459aef3c3c1edc7bc1b6e1f9957e.zip
Bug 537144 [etUnit] fixed test case time
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
index 603b14c07..bfc8dc2e2 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c
@@ -35,6 +35,11 @@ static etBool etUnit_testcaseSuccess[ETUNIT_MAX_TEST_CASES];
/* time measuring */
static etTime etUnit_startTime;
+static etTime etUnit_lastTestCaseTime;
+
+etInt16 getCurrentEtUnitId() {
+ return etUnit_nextCaseId - 1;
+}
/* order */
#define ETUNIT_ORDER_MAX 16
@@ -155,6 +160,7 @@ etInt16 etUnit_openTestCase(const char* testCaseName) {
}
if (etUnit_reportfile != NULL) {
etLogger_fprintf(etUnit_reportfile, "tc start %d: %s\n", caseId, testCaseName);
+ getTimeFromTarget(&etUnit_lastTestCaseTime);
}
return caseId;
@@ -164,7 +170,7 @@ void etUnit_closeTestCase(etInt16 id) {
etTime time;
OrderInfo* info;
getTimeFromTarget(&time);
- etTimeHelpers_subtract(&time, &etUnit_startTime);
+ etTimeHelpers_subtract(&time, &etUnit_lastTestCaseTime);
info = getOrderInfo(id);
if(info != NULL){