diff options
author | Juergen Haug | 2015-07-31 10:57:22 +0000 |
---|---|---|
committer | Juergen Haug | 2015-07-31 15:05:30 +0000 |
commit | b60e224ecf3eddd9e93fd44308769f84ffc19744 (patch) | |
tree | a595b8745f525ebbb21c9d4877229bd9cbc265e7 /tests/org.eclipse.etrice.runtime.c.tests | |
parent | 33c71f0684c7483aa25428d765ebfb089a954a67 (diff) | |
download | org.eclipse.etrice-b60e224ecf3eddd9e93fd44308769f84ffc19744.tar.gz org.eclipse.etrice-b60e224ecf3eddd9e93fd44308769f84ffc19744.tar.xz org.eclipse.etrice-b60e224ecf3eddd9e93fd44308769f84ffc19744.zip |
Bug 473951 - [runtime.c] runtime.c.tests fail under windows
Change-Id: Id19f37c2173c5206101ee78d4ea7745b46afa897
Diffstat (limited to 'tests/org.eclipse.etrice.runtime.c.tests')
6 files changed, 32 insertions, 13 deletions
diff --git a/tests/org.eclipse.etrice.runtime.c.tests/.cproject b/tests/org.eclipse.etrice.runtime.c.tests/.cproject index 6253bc1fe..e42164ec4 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/.cproject +++ b/tests/org.eclipse.etrice.runtime.c.tests/.cproject @@ -30,7 +30,6 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}""/> </option> <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1675025027" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/> @@ -40,10 +39,12 @@ <tool id="cdt.managedbuild.tool.gnu.c.linker.base.935085337" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"> <option id="gnu.c.link.option.libs.766992531" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs"> <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/> + <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="pthread"/> <listOptionValue builtIn="false" value="rt"/> + <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="lm"/> </option> <option id="gnu.c.link.option.paths.1505328291" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/WindowsMinGW}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/LinuxPosix}""/> </option> <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.154971939" superClass="cdt.managedbuild.tool.gnu.c.linker.input"> <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/> @@ -56,7 +57,7 @@ <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/common}""/> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/config}""/> - <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW}""/> + <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC}""/> </option> <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1350827128" superClass="cdt.managedbuild.tool.gnu.assembler.input"/> </tool> @@ -65,13 +66,13 @@ </configuration> </storageModule> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"> - <externalSettings containerId="org.eclipse.etrice.runtime.c;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> + <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919.294295052" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> <externalSetting> <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/config"/> - <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_WIN_MinGW"/> - <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/WindowsMinGW"/> + <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/platforms/MT_POSIX_GENERIC_GCC"/> + <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/org.eclipse.etrice.runtime.c/LinuxPosix"/> <entry flags="RESOLVED" kind="libraryFile" name="org.eclipse.etrice.runtime.c" srcPrefixMapping="" srcRootPath=""/> </externalSetting> </externalSettings> @@ -123,6 +124,7 @@ <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.base.1234008866" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.base"> <option id="gnu.c.link.option.libs.2073767331" name="Libraries (-l)" superClass="gnu.c.link.option.libs" valueType="libs"> <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="org.eclipse.etrice.runtime.c"/> + <listOptionValue builtIn="false" srcPrefixMapping="" srcRootPath="" value="ws2_32"/> </option> <option id="gnu.c.link.option.paths.714773418" name="Library search path (-L)" superClass="gnu.c.link.option.paths" valueType="libPaths"> <listOptionValue builtIn="false" value=""${workspace_loc:/org.eclipse.etrice.runtime.c/WindowsMinGW}""/> @@ -138,7 +140,7 @@ </configuration> </storageModule> <storageModule moduleId="org.eclipse.cdt.core.externalSettings"> - <externalSettings containerId="org.eclipse.etrice.runtime.c;" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> + <externalSettings containerId="org.eclipse.etrice.runtime.c;cdt.managedbuild.config.gnu.mingw.lib.debug.1978608919" factoryId="org.eclipse.cdt.core.cfg.export.settings.sipplier"> <externalSetting> <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/org.eclipse.etrice.runtime.c"/> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="includePath" name="/org.eclipse.etrice.runtime.c/src/common"/> diff --git a/tests/org.eclipse.etrice.runtime.c.tests/.gitignore b/tests/org.eclipse.etrice.runtime.c.tests/.gitignore index c650a7a97..4109ff354 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/.gitignore +++ b/tests/org.eclipse.etrice.runtime.c.tests/.gitignore @@ -3,4 +3,4 @@ MinGWDebug bin output results -tmp +log diff --git a/tests/org.eclipse.etrice.runtime.c.tests/make.xml b/tests/org.eclipse.etrice.runtime.c.tests/make.xml index 7fe1b251c..fa60157d5 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/make.xml +++ b/tests/org.eclipse.etrice.runtime.c.tests/make.xml @@ -47,7 +47,7 @@ set_platform: sets the runtime.platform property if not set already --> <target name="set_platform" unless="runtime.platform"> - <!-- + <!-- change libaries in build target, too ! <property name="runtime.platform" value="MT_WIN_MinGW"/> --> <property name="runtime.platform" value="MT_POSIX_GENERIC_GCC"/> @@ -195,6 +195,9 @@ <arg value="TestUtil.o"/> <!-- library has to be in the last position --> <arg value="-lorg.eclipse.etrice.runtime.c"/> + <!-- MinGW: -lws2_32--> + <!-- <arg value="-lws2_32"/> --> + <!-- Poxis: -lpthread - lrt - lm--> <arg value="-lpthread"/> <arg value="-lrt"/> <arg value="-lm"/> @@ -245,6 +248,7 @@ copy_results: copies the *.xml results to their final destination --> <target name="copy_results" depends="set_tr"> + <mkdir dir="results"/> <move file="./log/testlog/TestEtUnitSpecial.xml" tofile="./log/testlog/CTestEtUnitSpecial.xml"/> <copy todir="${test.results}" > <fileset dir="./log/testlog"> diff --git a/tests/org.eclipse.etrice.runtime.c.tests/org.eclipse.etrice.runtime.c.tests make.xml.launch b/tests/org.eclipse.etrice.runtime.c.tests/org.eclipse.etrice.runtime.c.tests make.xml.launch index c71b14a04..730fb51a5 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/org.eclipse.etrice.runtime.c.tests make.xml.launch +++ b/tests/org.eclipse.etrice.runtime.c.tests/org.eclipse.etrice.runtime.c.tests make.xml.launch @@ -7,6 +7,11 @@ <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES"> <listEntry value="1"/> </listAttribute> +<mapAttribute key="org.eclipse.debug.core.environmentVariables"> +<mapEntry key="ETRICE_C_RUNTIME" value="${project_loc:../org.eclipse.etrice.runtime.c}"/> +<mapEntry key="ETRICE_GCC_PATH" value="C:\MinGW\bin"/> +<mapEntry key="ETRICE_TARGET_PLATFORM" value="${eclipse_home}"/> +</mapAttribute> <stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/> <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.internal.launching.remote.InternalAntRunner"/> diff --git a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtMessageService.c b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtMessageService.c index 8112f635a..0867bf366 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtMessageService.c +++ b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtMessageService.c @@ -212,7 +212,8 @@ void TestEtMessageService_execute(etInt16 id){ EXPECT_EQUAL_INT16(id, "deliverAllMessages receivedEventIDCounter", 2, receivedEventIDCounter); etMessageService_stop(&msgService); - + // workaround: wait before destroy, thus preventing segmentation fault from msgServic thread + etThread_sleep(100); etMessageService_destroy(&msgService); } @@ -287,7 +288,7 @@ void TestEtMessageService_getMessagePoolLowWaterMark(etInt16 id){ /* still no message left */ EXPECT_EQUAL_INT16(id, "low water mark 6", 0, etMessageService_getMessagePoolLowWaterMark(&msgService)); - + etMessageService_destroy(&msgService); } diff --git a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtTimer.c b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtTimer.c index 6714b20b2..9d8345867 100644 --- a/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtTimer.c +++ b/tests/org.eclipse.etrice.runtime.c.tests/src/runtime/TestEtTimer.c @@ -26,15 +26,18 @@ static etSema GlobalSema; static etInt32 counter; +static etBool timerIsInvalidated; static void TestEtTimer_TimerCallback1(void* data){ printf("TestEtTimer_TimerCallback1\n"); fflush(stdout); // TODO: remove debug output - etSema_wakeup(&GlobalSema); + if(!timerIsInvalidated) + etSema_wakeup(&GlobalSema); } static void TestEtTimer_TimerCallback2(void* data){ printf("TestEtTimer_TimerCallback2\n"); fflush(stdout); // TODO: remove debug output - counter++; + if(!timerIsInvalidated) + counter++; } static void TestEtTimer_lifecycle (etInt16 id) { @@ -52,6 +55,7 @@ static void TestEtTimer_lifecycle (etInt16 id) { /* create semaphore */ etSema_construct(&GlobalSema); + timerIsInvalidated = false; getTimeFromTarget(&startTime); printf("TestEtTimer_lifecycle: start timer\n"); fflush(stdout); // TODO: remove debug output @@ -60,6 +64,7 @@ static void TestEtTimer_lifecycle (etInt16 id) { etSema_waitForWakeup(&GlobalSema); /* wait until callback function releases timer the first time (fires immediately) */ printf("TestEtTimer_lifecycle: wait again\n"); fflush(stdout); // TODO: remove debug output etSema_waitForWakeup(&GlobalSema); /* wait until callback function releases timer the second time (fires after first interval)*/ + timerIsInvalidated = true; etTimer_stop(&timer1); getTimeFromTarget(&endTime); @@ -84,6 +89,7 @@ static void TestEtTimer_multiTimer (etInt16 id) { etTimer timer2; etTime interval; counter = 0; + timerIsInvalidated = false; /* create semaphore */ etSema_construct(&GlobalSema); @@ -109,6 +115,7 @@ static void TestEtTimer_multiTimer (etInt16 id) { //sleep(10); + timerIsInvalidated = true; etTimer_stop(&timer2); etTimer_stop(&timer1); |