Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Haug2021-06-11 04:01:19 -0400
committerJuergen Haug2021-06-25 11:27:43 -0400
commit169ac7ae3f6cd8609c8b541ce4d47f4c1bc5e85c (patch)
tree8cbc94f3d39edbf387b8610a6d0cab566e89a01f
parent04a2b38e0d7a7707a8dc643c2aae31162a4e3c69 (diff)
downloadorg.eclipse.etrice-etunit_unlimited_tests.tar.gz
org.eclipse.etrice-etunit_unlimited_tests.tar.xz
org.eclipse.etrice-etunit_unlimited_tests.zip
[runtime.c] etunit removed limit for test casesetunit_unlimited_tests
* added switch for parallel testing * added support for custom output function * added more checks and asserts Change-Id: I0a670bf1c7045f721bc9802e1cea56dbbaf3a72b
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.c138
-rw-r--r--runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h44
-rw-r--r--tests/org.eclipse.etrice.runtime.c.tests/build.gradle6
-rw-r--r--tests/org.eclipse.etrice.runtime.c.tests/src/runtime/RunCRuntimeTestcases.c44
-rw-r--r--tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtUnit.c42
5 files changed, 225 insertions, 49 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 c8ebfe68a..dfdcc1ce9 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
@@ -16,6 +16,7 @@
#include <string.h>
#include <time.h>
#include <stdlib.h>
+#include <assert.h>
#include "debugging/etLogger.h"
#include "osal/etSema.h"
#include "runtime/etRuntime.h"
@@ -25,13 +26,16 @@
/* file handling */
static FILE* etUnit_reportfile = NULL;
+static etUnit_WriteFunction etUnit_write = NULL;
/* counters */
static etInt16 etUnit_nextCaseId;
static etInt32 etUnit_errorCounter;
-#define ETUNIT_MAX_TEST_CASES 512
-static etBool etUnit_testcaseSuccess[ETUNIT_MAX_TEST_CASES];
+static etBool etUnit_parallelTestCases = ET_FALSE;
+#define ETUNIT_MAX_PARALLEL_TEST_CASES 2
+static etBool etUnit_testcaseSuccess[ETUNIT_MAX_PARALLEL_TEST_CASES];
+static etBool etUnit_testcaseOpen[ETUNIT_MAX_PARALLEL_TEST_CASES];
#define ETUNIT_FAILURE_TEXT_LEN 256
@@ -39,8 +43,35 @@ static etBool etUnit_testcaseSuccess[ETUNIT_MAX_TEST_CASES];
static etTime etUnit_startTime;
static etTime etUnit_lastTestCaseTime;
-etInt16 getCurrentEtUnitId() {
- return etUnit_nextCaseId - 1;
+
+/*
+ * Returns index to store current test case state
+ * - 'caseId' for parallel test cases
+ * - 0 for singleton test case
+ */
+static etInt16 getParallelIndex(etInt16 caseId) {
+ etInt16 id = (etUnit_parallelTestCases) ? caseId - 1 : 0;
+ assert(id >= 0 && id <= ETUNIT_MAX_PARALLEL_TEST_CASES);
+ return id;
+}
+
+/* Lookup valid open test case id */
+static etInt16 getOpenTestCaseId(etInt16 id) {
+ etInt16 caseId;
+ if (etUnit_parallelTestCases) {
+ // index is id of parallel test case
+ assert(id > 0);
+ caseId = id;
+ } else {
+ // index is 0, return current open test case
+ assert(id == 0);
+ caseId = etUnit_nextCaseId - 1;
+ }
+ if(!etUnit_testcaseOpen[getParallelIndex(caseId)]) {
+ etLogger_logErrorF("Test case was not opened");
+ }
+
+ return caseId;
}
/* order */
@@ -54,9 +85,9 @@ typedef struct OrderInfo {
static OrderInfo etUnit_orderInfo[ETUNIT_ORDER_MAX];
static OrderInfo* getOrderInfo(etInt16 id) {
- int i;
- for (i = 0; i < ETUNIT_ORDER_MAX; ++i)
- if (etUnit_orderInfo[i].id == id)
+ etInt16 caseId = getOpenTestCaseId(id);
+ for (int i = 0; i < ETUNIT_ORDER_MAX; ++i)
+ if (etUnit_orderInfo[i].id == caseId)
return etUnit_orderInfo + i;
return NULL;
@@ -89,6 +120,16 @@ static void expect_range_float(etInt16 id, const char* message, etUnitFloat min,
static void etUnit_handleExpect(etInt16 id, etBool result, const char *trace, const char* expected, const char* actual, const char* file, int line);
+/* configuration functions */
+
+void etUnit_setParallelTestCases(etBool enabled) {
+ etUnit_parallelTestCases = enabled;
+}
+
+void etUnit_setWriteFunction(etUnit_WriteFunction fct) {
+ etUnit_write = fct;
+}
+
/* public functions */
void etUnit_open(const char* testResultPath, const char* testFileName) {
@@ -96,7 +137,6 @@ void etUnit_open(const char* testResultPath, const char* testFileName) {
{
char filename[ETUNIT_FAILURE_TEXT_LEN];
- int i;
if (testResultPath != NULL)
snprintf(filename, sizeof(filename), "%s/%s.etu", testResultPath, testFileName);
@@ -104,21 +144,28 @@ void etUnit_open(const char* testResultPath, const char* testFileName) {
snprintf(filename, sizeof(filename),"%s.etu", testFileName);
/* init global data */
- for (i = 0; i < ETUNIT_ORDER_MAX; ++i)
+ for (int i = 0; i < ETUNIT_ORDER_MAX; ++i) {
etUnit_orderInfo[i].id = 0;
- for (i = 0; i < ETUNIT_MAX_TEST_CASES; ++i)
+ }
+ for (int i = 0; i < ETUNIT_MAX_PARALLEL_TEST_CASES; ++i) {
etUnit_testcaseSuccess[i] = ET_TRUE;
+ etUnit_testcaseOpen[i] = ET_FALSE;
+ }
etUnit_errorCounter = 0;
etUnit_nextCaseId = 1;
- if (etUnit_reportfile == NULL) {
+ if (etUnit_write == NULL && etUnit_reportfile == NULL) {
+ // default write to file
etUnit_reportfile = etLogger_fopen(filename, "w+");
if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "etUnit report\n");
+ etUnit_setWriteFunction((etUnit_WriteFunction) etLogger_fprintf);
} else {
etLogger_logErrorF("Unable to open file %s", filename);
}
}
+ if(etUnit_write != null) {
+ etUnit_write(etUnit_reportfile, "etUnit report\n");
+ }
}
/* prepare time measurement */
@@ -130,6 +177,7 @@ void etUnit_close(void) {
if (etUnit_reportfile != NULL) {
etLogger_fclose(etUnit_reportfile);
etUnit_reportfile = NULL;
+ etUnit_write = NULL;
}
getTimeFromTarget(&endTime);
etTimeHelpers_subtract(&endTime, &etUnit_startTime);
@@ -142,51 +190,65 @@ void etUnit_close(void) {
}
void etUnit_openTestSuite(const char* testSuiteName) {
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "ts start: %s\n", testSuiteName);
+ if(etUnit_write != NULL) {
+ etUnit_write(etUnit_reportfile, "ts start: %s\n", testSuiteName);
}
}
void etUnit_closeTestSuite(void) {
}
+/* Opens new test case, if parallel is activated returns new test case id otherwise 0*/
etInt16 etUnit_openTestCase(const char* testCaseName) {
+ if(etUnit_nextCaseId >= INT16_MAX) {
+ etLogger_logErrorF("Too many test cases. Maximum number is %d", INT16_MAX);
+ exit(-1);
+ }
etInt16 caseId = etUnit_nextCaseId++;
-
- if (caseId >= ETUNIT_MAX_TEST_CASES) {
- etLogger_logErrorF("Too many test cases. Maximum number of test cases is %d\n",
- ETUNIT_MAX_TEST_CASES);
- etLogger_logErrorF("ETUNIT_MAX_TEST_CASES (etUnit_openTestCase, %s: %d)", __FILE__,
- __LINE__);
+ etInt16 idx = getParallelIndex(caseId);
+ if (etUnit_parallelTestCases && idx >= ETUNIT_MAX_PARALLEL_TEST_CASES) {
+ etLogger_logErrorF("Too many parallel test cases. Maximum number is %d", ETUNIT_MAX_PARALLEL_TEST_CASES);
exit(-1);
}
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "tc start %d: %s\n", caseId, testCaseName);
+ if(etUnit_write != NULL) {
+ etUnit_write(etUnit_reportfile, "tc start %d: %s\n", caseId, testCaseName);
getTimeFromTarget(&etUnit_lastTestCaseTime);
}
- return caseId;
+
+ if(etUnit_testcaseOpen[idx]) {
+ etLogger_logErrorF("Previous test case was not closed");
+ }
+ etUnit_testcaseOpen[idx] = ET_TRUE;
+ etUnit_testcaseSuccess[idx] = ET_TRUE;
+
+ return (etUnit_parallelTestCases) ? caseId : 0;
}
void etUnit_closeTestCase(etInt16 id) {
+ etInt16 caseId = getOpenTestCaseId(id);
OrderInfo* info = getOrderInfo(id);
if(info != NULL){
if (info->currentIndex != info->size) {
etUnit_handleExpect(id, ET_FALSE, "EXPECT_ORDER was not completed", NULL, NULL, 0, 0);
+ info->id = 0;
}
}
+ etInt16 parallelId = getParallelIndex(caseId);
+ etUnit_testcaseOpen[parallelId] = ET_FALSE;
- if (etUnit_reportfile != NULL) {
+ if(etUnit_write != NULL) {
etTime time;
getTimeFromTarget(&time);
etTimeHelpers_subtract(&time, &etUnit_lastTestCaseTime);
- etLogger_fprintf(etUnit_reportfile, "tc end %d: %d\n", id, etTimeHelpers_convertToMSec(&time));
+ etUnit_write(etUnit_reportfile, "tc end %d: %d\n", caseId, etTimeHelpers_convertToMSec(&time));
}
}
void etUnit_skipTestCase(etInt16 id, const char* msg) {
- if (etUnit_reportfile != NULL) {
- etLogger_fprintf(etUnit_reportfile, "tc skip %d: %s\n", id, msg);
+ etInt16 caseId = getOpenTestCaseId(id);
+ if(etUnit_write != NULL) {
+ etUnit_write(etUnit_reportfile, "tc skip %d: %s\n", caseId, msg);
}
}
@@ -294,10 +356,11 @@ void expectRangeFloat64(etInt16 id, const char* message, etFloat64 min, etFloat6
#endif
void expectOrderStart(etInt16 id, etInt16* list, etInt16 size, const char* file, int line) {
- int i;
- for (i = 0; i < ETUNIT_ORDER_MAX; ++i)
+ // TODO report error if previous order was not closed
+ etInt16 caseId = getOpenTestCaseId(id);
+ for (int i = 0; i < ETUNIT_ORDER_MAX; ++i)
if (etUnit_orderInfo[i].id == 0) {
- etUnit_orderInfo[i].id = id;
+ etUnit_orderInfo[i].id = caseId;
etUnit_orderInfo[i].currentIndex = 0;
etUnit_orderInfo[i].size = size;
etUnit_orderInfo[i].list = list;
@@ -341,7 +404,7 @@ void expectOrderEnd(etInt16 id, const char* message, etInt16 identifier, const c
}
etBool etUnit_isSuccess(etInt16 id) {
- return etUnit_testcaseSuccess[id];
+ return etUnit_testcaseSuccess[getParallelIndex(id)];
}
/* private functions */
@@ -446,18 +509,21 @@ static void expect_range_float(etInt16 id, const char* message, etUnitFloat min,
#endif
static void etUnit_handleExpect(etInt16 id, etBool result, const char *resulttext, const char* exp, const char* act, const char* file, int line) {
+ // check open
+ etInt16 caseId = getOpenTestCaseId(id);
if (result == ET_TRUE) {
/* nothing to do because no failure */
} else {
etUnit_errorCounter++;
- if (etUnit_testcaseSuccess[id] == ET_TRUE) {
+ etInt16 parallelId = getParallelIndex(caseId);
+ if (etUnit_testcaseSuccess[parallelId] == ET_TRUE) {
/* first failure will be remembered */
- etUnit_testcaseSuccess[id] = ET_FALSE;
-
+ etUnit_testcaseSuccess[parallelId] = ET_FALSE;
+
if (act != NULL && exp != NULL)
- etLogger_fprintf(etUnit_reportfile, "tc fail %d: #%s#%s#%s:%d#%s\n", id, exp, act, file, line, resulttext);
+ etUnit_write(etUnit_reportfile, "tc fail %d: #%s#%s#%s:%d#%s\n", caseId, exp, act, file, line, resulttext);
else
- etLogger_fprintf(etUnit_reportfile, "tc fail %d: ###%s:%d#%s\n", id, file, line, resulttext);
+ etUnit_write(etUnit_reportfile, "tc fail %d: ###%s:%d#%s\n", caseId, file, line, resulttext);
} else {
/* more than one error will be ignored */
}
diff --git a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
index e666b00b0..8f86d53fe 100644
--- a/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
+++ b/runtime/org.eclipse.etrice.runtime.c/src/common/etUnit/etUnit.h
@@ -33,6 +33,8 @@ ET_EXTERN_C_BEGIN
// compile time evaluated
#define ETUNIT_FILENAME (strrchr(__FILE__, '\\') ? strrchr(__FILE__, '\\') + 1 : (strrchr(__FILE__, '/') ? strrchr(__FILE__, '/') + 1 : __FILE__))
+typedef void (*etUnit_WriteFunction)(void* handle, const char* format, ...);
+
/**
* opens a file to protocol the test results
*
@@ -55,12 +57,20 @@ void etUnit_openTestSuite(const char* testSuiteName);
*/
void etUnit_closeTestSuite(void);
/**
+ * enable support for parallel test cases (default false)
+ */
+void etUnit_setParallelTestCases(etBool enabled);
+/**
+ * write etunit output to callback
+ */
+void etUnit_setWriteFunction(etUnit_WriteFunction fct);
+/**
* opens a test case. Multiple test cases can be open at a time
*
* \param testCaseName the name of the test case
*
- * \return an id for the test case which has to be used as an identifier
- * for the expect... and other methods
+ * \return in case of parallel testing an id which has to be used as an identifier
+ * for the expects and other methods, otherwise zero
*/
etInt16 etUnit_openTestCase(const char* testCaseName);
/**
@@ -186,6 +196,36 @@ void etUnit_closeAll(etInt16 id);
/*
+ * Alternative expects omitting id argument (without parallel testing)
+ */
+
+#define ETUNIT_TRUE(msg, condition) expectTrue(0, msg, condition, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_FALSE(msg, condition) expectFalse(0, msg, condition, ETUNIT_FILENAME, __LINE__)
+
+#define ETUNIT_EQUAL_INT(msg, expected, actual) expectEqualInt32(0, msg, expected, actual, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_EQUAL_UINT(msg, expected, actual) expectEqualUInt32(0, msg, expected, actual, ETUNIT_FILENAME, __LINE__)
+
+#ifdef ET_FLOAT32
+#define ETUNIT_EQUAL_FLOAT32(msg, expected, actual, precision) expectEqualFloat32(0, msg, expected, actual, precision, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_RANGE_FLOAT32(msg, min, max, actual) expectRangeFloat32(0, msg, min, max, actual, ETUNIT_FILENAME, __LINE__)
+#endif
+
+#ifdef ET_FLOAT64
+#define ETUNIT_EQUAL_FLOAT64(msg, expected, actual, precision) expectEqualFloat64(0, msg, expected, actual, precision, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_RANGE_FLOAT64(msg, min, max, actual) expectRangeFloat64(0, msg, min, max, actual, ETUNIT_FILENAME, __LINE__)
+#endif
+
+#define ETUNIT_EQUAL_PTR(msg, expected, actual) \
+ expect_equal_void_ptr(ETUNIT_SINGLETON_TEST_CASE_ID, msg, (const void*) expected, (const void*) actual, ETUNIT_FILENAME, __LINE__)
+
+#define ETUNIT_EQUAL_STR(msg, expected, actual) expectEqualStr(0, msg, expected, actual, ETUNIT_FILENAME, __LINE__)
+
+#define ETUNIT_ORDER_START(list, size) expectOrderStart(0, list, size, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_ORDER(msg, val) expectOrder(0, msg, val, ETUNIT_FILENAME, __LINE__)
+#define ETUNIT_ORDER_END(msg, val) expectOrderEnd(0, msg, val, ETUNIT_FILENAME, __LINE__)
+
+
+/*
* Helpers for adding test cases
*/
diff --git a/tests/org.eclipse.etrice.runtime.c.tests/build.gradle b/tests/org.eclipse.etrice.runtime.c.tests/build.gradle
index ad6c20e01..01b6df94e 100644
--- a/tests/org.eclipse.etrice.runtime.c.tests/build.gradle
+++ b/tests/org.eclipse.etrice.runtime.c.tests/build.gradle
@@ -34,7 +34,9 @@ model {
def exeFile = "$buildDir/exe/etrice_runtime_c_tests/etrice_runtime_c_tests"
def etuFileRuntimeTest = "$buildDir/log/TestCRuntime.etu"
-def etuFileEtUnitTest = "$buildDir/log/TestEtUnitSpecial.etu"
+def etuFileEtUnitTest = "$buildDir/log/TestEtUnit.etu"
+def etuFileEtUnitSpecialTest = "$buildDir/log/TestEtUnitSpecial.etu"
+def etuFileEtUnitWriteTest = "$buildDir/log/TestEtUnitWrite.etu"
task run(type: Exec, dependsOn: assemble, group: 'verification') {
executable exeFile
@@ -44,7 +46,7 @@ task run(type: Exec, dependsOn: assemble, group: 'verification') {
etunitConvert {
convert {
- source etuFileRuntimeTest, etuFileEtUnitTest
+ source etuFileRuntimeTest, etuFileEtUnitTest, etuFileEtUnitSpecialTest, etuFileEtUnitWriteTest
dependsOn run
}
}
diff --git a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/RunCRuntimeTestcases.c b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/RunCRuntimeTestcases.c
index 99036799c..064abec66 100644
--- a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/RunCRuntimeTestcases.c
+++ b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/RunCRuntimeTestcases.c
@@ -39,10 +39,45 @@
#include "etUnit/etUnit.h"
#include "debugging/etMSCLogger.h"
+#include "debugging/etLogger.h"
+
+etFileHandle etUnit_writeFile = NULL;
+void test_etUnitWriteFunction(void *handle, const char *format, ...) {
+ static str[100];
+ va_list arglist;
+ va_start(arglist, format);
+ vsprintf(str, format, arglist);
+ va_end(arglist);
+ etLogger_fprintf(etUnit_writeFile, str);
+}
void RunCRuntimeTestcases(void){
etInt16 id;
+
+ // test etUnit
+ etUnit_open("log","TestEtUnit");
+ TestEtUnit_runSuite();
+ etUnit_close();
+
+ /* special situation for testing openAll and closeAll of etUnit
+ * this has to be done outside of etUnit_open and etUnit_close */
+ id = etUnit_openAll("log","TestEtUnitSpecial", "org.eclipse.etrice.runtime.c.tests.etUnit", "openAll_and_closeAll");
+ ETUNIT_EQUAL_INT("Open and Close", 0, id);
+ etUnit_closeAll(id);
+
+ // test etUnit custom write
+ etUnit_writeFile = etLogger_fopen("log/TestEtUnitWrite.etu", "w");
+ etUnit_setWriteFunction(test_etUnitWriteFunction);
+ {
+ id = etUnit_openAll("", "_WriteToFunction_", "org.eclipse.etrice.runtime.c.tests.etUnit", "write");
+ ETUNIT_EQUAL_INT("Open and Close", 0, id);
+ etUnit_closeAll(id);
+ }
+ etUnit_setWriteFunction(NULL);
+ etLogger_fclose(etUnit_writeFile);
+
+
etMSCLogger_open("log", "test.log");
etUnit_open("log","TestCRuntime");
@@ -51,23 +86,14 @@ void RunCRuntimeTestcases(void){
TestEtMessage_runSuite();
TestEtMessageQueue_runSuite();
TestEtMessageService_runSuite();
- TestEtUnit_runSuite();
TestEtTimer_runSuite();
TestEtDatatypes_runSuite();
TestEtTimeHelpers_runSuite();
TestUtil_runSuite();
TestEtConsoleLogger_runSuite();
-
TestEtStaticDeque_runSuite();
etUnit_close();
-
- /* special situation for testing openAll and closeAll of etUnit
- * this has to be done outside of etUnit_open and etUnit_close */
- id = etUnit_openAll("log","TestEtUnitSpecial", "org.eclipse.etrice.runtime.c.tests.etUnit", "openAll_and_closeAll");
- EXPECT_TRUE(id, "Open and Close", ET_TRUE);
- etUnit_closeAll(id);
-
etMSCLogger_close();
}
diff --git a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtUnit.c b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtUnit.c
index 15525b7d0..a734f4efe 100644
--- a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtUnit.c
+++ b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtUnit.c
@@ -23,6 +23,8 @@
#include "TestEtUnit.h"
#include "etUnit/etUnit.h"
+#include <assert.h>
+
void TestEtUnit_Expect(etInt16 id){
EXPECT_TRUE(id, "EXPECT_TRUE", ET_TRUE);
EXPECT_FALSE(id, "EXPECT_FALSE", ET_FALSE);
@@ -60,8 +62,48 @@ void TestEtUnit_Expect_Order(etInt16 id){
EXPECT_ORDER_END(id, "id=4", 4);
}
+void TestEtUnit_Parallel_TestCase(){
+ etUnit_setParallelTestCases(true);
+ {
+ etInt16 id1 = etUnit_openTestCase("Parallel_Tc_1");
+ etInt16 id2 = etUnit_openTestCase("Parallel_Tc_2");
+
+ assert(id1 > 0);
+ EXPECT_TRUE(id1, "id > 0", id1 > 0);
+ assert(id2 > 0);
+ EXPECT_TRUE(id2, "id > 0", id2 > 0);
+ assert(id2 == id1 + 1);
+ EXPECT_TRUE(id2, "id incremented", id2 == id1 + 1);
+
+ etUnit_closeTestCase(id1);
+ etUnit_closeTestCase(id2);
+ }
+ etUnit_setParallelTestCases(false);
+}
+
+void TestEtUnit_Singleton_TestCase(){
+ etInt16 id = etUnit_openTestCase("Singleton_Tc_1");
+ assert(id == 0);
+ ETUNIT_EQUAL_INT("id=0", id, 0);
+ etUnit_closeTestCase(0);
+
+ id = etUnit_openTestCase("Singleton_Tc_2_unclosed");
+ assert(id == 0);
+ ETUNIT_EQUAL_UINT("id=0", id, 0);
+ // test case is not closed, check for warning
+
+ id = etUnit_openTestCase("Singleton_Tc_3");
+ assert(id == 0);
+ ETUNIT_FALSE("id=0", id);
+ etUnit_closeTestCase(0);
+}
+
+
void TestEtUnit_runSuite(void){
etUnit_openTestSuite("org.eclipse.etrice.runtime.c.tests.TestEtUnit");
+ // test parallel first due test case number restriction
+ TestEtUnit_Parallel_TestCase();
+ TestEtUnit_Singleton_TestCase();
ADD_TESTCASE(TestEtUnit_Expect_Order);
ADD_TESTCASE(TestEtUnit_Expect);
etUnit_closeTestSuite();

Back to the top