PageRenderTime 27ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/build/scripts/overnight/run_new_examples.bat

https://github.com/xrl/opensplice
Batch | 397 lines | 67 code | 83 blank | 247 comment | 17 complexity | d9188903260f01d4200a3915d23d05fa MD5 | raw file
  1. @ECHO OFF
  2. REM This is work in progress. All the examples cannot be in 1 file
  3. REM as this causes problems. We need a better solution. This file
  4. REM is temporary till that solution is found. Also the batch files
  5. REM with the new examples don't work on the overnight test runs so
  6. REM we need to fix them first. I suggest 1 by 1 and not altogether
  7. REM e.g. get the HelloWorld example working first then introduce the
  8. REM others incrementally
  9. SET FAILURES=%1
  10. SET PASS=%2
  11. SET COUNT=%3
  12. SET SLEEP10=@ping localhost -c 10
  13. SET SLEEP4=@ping localhost -c 4
  14. ECHO Set required environment variables
  15. call setenv.bat
  16. REM RUN_LOG is a logfile containing the full test results
  17. SET RUN_LOG="%LOGDIR%/examples/run/run_results.txt"
  18. REM RUN_SUMMARY_LOG is a logfile containing an entry as to whether the example
  19. REM passed or failed it is appended to the overview log at the end
  20. SET RUN_SUMMARY_LOG="%LOGDIR%/examples/run/run_results_summary.txt"
  21. REM SUMMARY_LOG Gives the number of examples run, the number that passed and
  22. REM the number that failed together with the result of each individual examples
  23. SET SUMMARY_LOG="%LOGDIR%/examples/run/examples.log"
  24. ECHO Running examples and LOGDIR is %LOGDIR%
  25. ECHO Set Microsoft Visual Studio Environment using VS supplied batch file
  26. REM IF "%VS_ENV_SCRIPT%"=="" EXIT 1
  27. REM IF NOT "%VS_ENV_SCRIPT%"=="" call "%VS_ENV_SCRIPT%"
  28. REM cd "%OSPL_HOME%"
  29. REM ECHO Set OSPL runtime environment
  30. REM call release.bat
  31. REM mkdir "%OSPL_HOME%\etc\tmp"
  32. REM IF "%TMP%"=="" set TMP=%OSPL_HOME%\etc\tmp
  33. REM IF "%TEMP%"=="" set TEMP=%OSPL_HOME%\etc\tmp
  34. ECHO Change to the examples directory
  35. cd "%OSPL_HOME%/examples"
  36. REM sh ./set_xml.sh
  37. REM call swap_URI.bat
  38. SET LOGFILE=run.log
  39. REM :SACPPHelloWorld
  40. REM SET EXAMPLE=dcps/HelloWorld/C++/Standalone/VS2005/Bat
  41. REM SET NEXTEXAMPLE=SACHelloWorld
  42. REM CALL :RunNewExample
  43. REM :SACHelloWorld
  44. REM SET EXAMPLE=dcps/HelloWorld/C/Standalone/VS2005/Bat
  45. REM SET NEXTEXAMPLE=SAJHelloWorld
  46. REM CALL :RunNewExample
  47. REM :SAJHelloWorld
  48. REM SET EXAMPLE=dcps/HelloWorld/Java/Standalone/Windows/Bat
  49. REM SET NEXTEXAMPLE=CCPPHelloWorld
  50. REM CALL :RunNewExample
  51. REM :CCPPHelloWorld
  52. REM SET EXAMPLE=dcps/HelloWorld/C++/OpenFusion/VS2005/Bat
  53. REM SET NEXTEXAMPLE=CJHelloWorld
  54. REM CALL :RunNewExample
  55. REM :CJHelloWorld
  56. REM SET EXAMPLE=dcps/HelloWorld/Java/Corba/JacORB/Windows/Bat
  57. REM SET NEXTEXAMPLE=SACSHelloWorld
  58. REM CALL :RunNewExample
  59. REM :SACSHelloWorld
  60. REM SET EXAMPLE=dcps/HelloWorld/CS/Standalone/VS2005/Bat
  61. REM SET NEXTEXAMPLE=DoneNew
  62. REM CALL :RunNewExample
  63. REM :SACPPContentFilteredTopic
  64. REM SET EXAMPLE=dcps/ContentFilteredTopic/C++/Standalone/VS2005/Bat
  65. REM SET NEXTEXAMPLE=SACContentFilteredTopic
  66. REM CALL :RunNewExample
  67. REM :SACContentFilteredTopic
  68. REM SET EXAMPLE=dcps/ContentFilteredTopic/C/Standalone/VS2005/Bat
  69. REM SET NEXTEXAMPLE=SAJContentFilteredTopic
  70. REM CALL :RunNewExample
  71. REM :SAJContentFilteredTopic
  72. REM SET EXAMPLE=dcps/ContentFilteredTopic/Java/Standalone/Windows/Bat
  73. REM SET NEXTEXAMPLE=CCPPContentFilteredTopic
  74. REM CALL :RunNewExample
  75. REM :CCPPContentFilteredTopic
  76. REM SET EXAMPLE=dcps/ContentFilteredTopic/C++/OpenFusion/VS2005/Bat
  77. REM SET NEXTEXAMPLE=CJContentFilteredTopic
  78. REM CALL :RunNewExample
  79. REM :CJContentFilteredTopic
  80. REM SET EXAMPLE=dcps/ContentFilteredTopic/Java/Corba/JacORB/Windows/Bat
  81. REM SET NEXTEXAMPLE=SACSContentFilteredTopic
  82. REM CALL :RunNewExample
  83. REM :SACSContentFilteredTopic
  84. REM SET EXAMPLE=dcps/ContentFilteredTopic/CS/Standalone/VS2005/Bat
  85. REM SET NEXTEXAMPLE=SACPPListener
  86. REM CALL :RunNewExample
  87. REM :SACPPListener
  88. REM SET EXAMPLE=dcps/Listener/C++/Standalone/VS2005/Bat
  89. REM SET NEXTEXAMPLE=SACListener
  90. REM CALL :RunNewExample
  91. REM :SACListener
  92. REM SET EXAMPLE=dcps/Listener/C/Standalone/VS2005/Bat
  93. REM SET NEXTEXAMPLE=SAJListener
  94. REM CALL :RunNewExample
  95. REM :SAJListener
  96. REM SET EXAMPLE=dcps/Listener/Java/Standalone/Windows/Bat
  97. REM SET NEXTEXAMPLE=CCPPListener
  98. REM CALL :RunNewExample
  99. REM :CCPPListener
  100. REM SET EXAMPLE=dcps/Listener/C++/OpenFusion/VS2005/Bat
  101. REM SET NEXTEXAMPLE=CJListener
  102. REM CALL :RunNewExample
  103. REM :CJListener
  104. REM SET EXAMPLE=dcps/Listener/Java/Corba/JacORB/Windows/Bat
  105. REM SET NEXTEXAMPLE=SACSListener
  106. REM CALL :RunNewExample
  107. REM :SACSListener
  108. REM SET EXAMPLE=dcps/Listener/CS/Standalone/VS2005/Bat
  109. REM SET NEXTEXAMPLE=SACPPOwnership
  110. REM CALL :RunNewExample
  111. REM :SACPPOwnership
  112. REM SET EXAMPLE=dcps/Ownership/C++/Standalone/VS2005/Bat
  113. REM SET NEXTEXAMPLE=SACOwnership
  114. REM CALL :RunNewExample
  115. REM :SACOwnership
  116. REM SET EXAMPLE=dcps/Ownership/C/Standalone/VS2005/Bat
  117. REM SET NEXTEXAMPLE=SAJOwnership
  118. REM CALL :RunNewExample
  119. REM :SAJOwnership
  120. REM SET EXAMPLE=dcps/Ownership/Java/Standalone/Windows/Bat
  121. REM SET NEXTEXAMPLE=CCPPOwnership
  122. REM CALL :RunNewExample
  123. REM :CCPPOwnership
  124. REM SET EXAMPLE=dcps/Ownership/C++/OpenFusion/VS2005/Bat
  125. REM SET NEXTEXAMPLE=CJOwnership
  126. REM CALL :RunNewExample
  127. REM :CJOwnership
  128. REM SET EXAMPLE=dcps/Ownership/Java/Corba/JacORB/Windows/Bat
  129. REM SET NEXTEXAMPLE=SACSOwnership
  130. REM CALL :RunNewExample
  131. REM :SACSOwnership
  132. REM SET EXAMPLE=dcps/Ownership/CS/Standalone/VS2005/Bat
  133. REM SET NEXTEXAMPLE=SACPPQueryCondition
  134. REM CALL :RunNewExample
  135. REM :SACPPQueryCondition
  136. REM SET EXAMPLE=dcps/QueryCondition/C++/Standalone/VS2005/Bat
  137. REM SET NEXTEXAMPLE=SACQueryCondition
  138. REM CALL :RunNewExample
  139. REM :SACQueryCondition
  140. REM SET EXAMPLE=dcps/QueryCondition/C/Standalone/VS2005/Bat
  141. REM SET NEXTEXAMPLE=SAJQueryCondition
  142. REM CALL :RunNewExample
  143. REM :SAJQueryCondition
  144. REM SET EXAMPLE=dcps/QueryCondition/Java/Standalone/Windows/Bat
  145. REM SET NEXTEXAMPLE=CCPPQueryCondition
  146. REM CALL :RunNewExample
  147. REM :CCPPQueryCondition
  148. REM SET EXAMPLE=dcps/QueryCondition/C++/OpenFusion/VS2005/Bat
  149. REM SET NEXTEXAMPLE=CJQueryCondition
  150. REM CALL :RunNewExample
  151. REM :CJQueryCondition
  152. REM SET EXAMPLE=dcps/QueryCondition/Java/Corba/JacORB/Windows/Bat
  153. REM SET NEXTEXAMPLE=SACSQueryCondition
  154. REM CALL :RunNewExample
  155. REM :SACSQueryCondition
  156. REM SET EXAMPLE=dcps/QueryCondition/CS/Standalone/VS2005/Bat
  157. REM SET NEXTEXAMPLE=SACPPWaitSet
  158. REM CALL :RunNewExample
  159. REM :SACPPWaitSet
  160. REM SET EXAMPLE=dcps/WaitSet/C++/Standalone/VS2005/Bat
  161. REM SET NEXTEXAMPLE=SACWaitSet
  162. REM CALL :RunNewExample
  163. REM :SACWaitSet
  164. REM SET EXAMPLE=dcps/WaitSet/C/Standalone/VS2005/Bat
  165. REM SET NEXTEXAMPLE=SAJWaitSet
  166. REM CALL :RunNewExample
  167. REM :SAJWaitSet
  168. REM SET EXAMPLE=dcps/WaitSet/Java/Standalone/Windows/Bat
  169. REM SET NEXTEXAMPLE=CCPPWaitSet
  170. REM CALL :RunNewExample
  171. REM :CCPPWaitSet
  172. REM SET EXAMPLE=dcps/WaitSet/C++/OpenFusion/VS2005/Bat
  173. REM SET NEXTEXAMPLE=CJWaitSet
  174. REM CALL :RunNewExample
  175. REM :CJWaitSet
  176. REM SET EXAMPLE=dcps/WaitSet/Java/Corba/JacORB/Windows/Bat
  177. REM SET NEXTEXAMPLE=SACSWaitSet
  178. REM CALL :RunNewExample
  179. REM :SACSWaitSet
  180. REM SET EXAMPLE=dcps/WaitSet/CS/Standalone/VS2005/Bat
  181. REM SET NEXTEXAMPLE=SACPPBuiltInTopics
  182. REM CALL :RunNewExample
  183. REM :SACPPBuiltInTopics
  184. REM SET EXAMPLE=dcps/BuiltInTopics/C++/Standalone/VS2005/Bat
  185. REM SET NEXTEXAMPLE=SACBuiltInTopics
  186. REM CALL :RunNewExample
  187. REM :SACBuiltInTopics
  188. REM SET EXAMPLE=dcps/BuiltInTopics/C/Standalone/VS2005/Bat
  189. REM SET NEXTEXAMPLE=SAJBuiltInTopics
  190. REM CALL :RunNewExample
  191. REM :SAJBuiltInTopics
  192. REM SET EXAMPLE=dcps/BuiltInTopics/Java/Standalone/Windows/Bat
  193. REM SET NEXTEXAMPLE=CCPPBuiltInTopics
  194. REM CALL :RunNewExample
  195. REM :CCPPBuiltInTopics
  196. REM SET EXAMPLE=dcps/BuiltInTopics/C++/OpenFusion/VS2005/Bat
  197. REM SET NEXTEXAMPLE=CJBuiltInTopics
  198. REM CALL :RunNewExample
  199. REM :CJBuiltInTopics
  200. REM SET EXAMPLE=dcps/BuiltInTopics/Java/Corba/JacORB/Windows/Bat
  201. REM SET NEXTEXAMPLE=SACSBuiltInTopics
  202. REM CALL :RunNewExample
  203. REM :SACSBuiltInTopics
  204. REM SET EXAMPLE=dcps/BuiltInTopics/CS/Standalone/VS2005/Bat
  205. REM SET NEXTEXAMPLE=DLRL
  206. REM CALL :RunNewExample
  207. REM DO NOT run Durability it hangs when run with overnights
  208. REM :SACPPDurability
  209. REM SET EXAMPLE=dcps/Durability/C++/Standalone/VS2005/Bat
  210. REM SET NEXTEXAMPLE=SACDurability
  211. REM CALL :RunNewExample
  212. REM :SACDurability
  213. REM SET EXAMPLE=dcps/Durability/C/Standalone/VS2005/Bat
  214. REM SET NEXTEXAMPLE=SAJDurability
  215. REM CALL :RunNewExample
  216. REM :SAJDurability
  217. REM SET EXAMPLE=dcps/Durability/Java/Standalone/Windows/Bat
  218. REM SET NEXTEXAMPLE=CCPPDurability
  219. REM CALL :RunNewExample
  220. REM :CCPPDurability
  221. REM SET EXAMPLE=dcps/Durability/C++/OpenFusion/VS2005/Bat
  222. REM SET NEXTEXAMPLE=CCDurability
  223. REM CALL :RunNewExample
  224. REM :CJDurability
  225. REM SET EXAMPLE=dcps/Durability/Java/Corba/JacORB/Windows/Bat
  226. REM SET NEXTEXAMPLE=SACSDurability
  227. REM CALL :RunNewExample
  228. REM :SACSDurability
  229. REM SET EXAMPLE=dcps/Durability/C/Standalone/VS2005/Bat
  230. REM SET NEXTEXAMPLE=SACPPListener
  231. REM CALL :RunNewExample
  232. REM DON NOT run - Lifecycle hangs when run with overnights
  233. REM :SACPPLifecycle
  234. REM SET EXAMPLE=dcps/Lifecycle/C++/Standalone/VS2005/Bat
  235. REM SET NEXTEXAMPLE=SACLifecycle
  236. REM CALL :RunNewExample
  237. REM :SACLifecycle
  238. REM SET EXAMPLE=dcps/Lifecycle/C/Standalone/VS2005/Bat
  239. REM SET NEXTEXAMPLE=SAJLifecycle
  240. REM CALL :RunNewExample
  241. REM :SAJLifecycle
  242. REM SET EXAMPLE=dcps/Lifecycle/Java/Standalone/Windows/Bat
  243. REM SET NEXTEXAMPLE=CCPPLifecycle
  244. REM CALL :RunNewExample
  245. REM :CCPPLifecycle
  246. REM SET EXAMPLE=dcps/Lifecycle/C++/OpenFusion/VS2005/Bat
  247. REM SET NEXTEXAMPLE=CCLifecycle
  248. REM CALL :RunNewExample
  249. REM :CJLifecycle
  250. REM SET EXAMPLE=dcps/Lifecycle/Java/Corba/JacORB/Windows/Bat
  251. REM SET NEXTEXAMPLE=done
  252. REM CALL :RunNewExample
  253. :DoneNew
  254. ECHO Ran limited set of new examples till batch files fixed
  255. GOTO END
  256. REM ###################
  257. REM RunNewExample section
  258. REM ##################
  259. :RunNewExample
  260. SET /A COUNT += 1
  261. ECHO ##### %EXAMPLE% #####
  262. cd "%OSPL_HOME%/examples/%EXAMPLE%"
  263. ECHO Starting %EXAMPLE% >> %LOGFILE%
  264. %SLEEP4% >NUL
  265. call RUN.bat >> %LOGFILE%
  266. %SLEEP10% >NUL
  267. CALL :ErrorCheckingResult
  268. REM #####################
  269. REM ErrorCheckingResult section
  270. REM #####################
  271. :ErrorCheckingResult
  272. SET ERROR=0
  273. SET TIMEOUT=0
  274. SET NOCLASSDEFFOUND=0
  275. SET ASSERTFAILED=0
  276. SET FAIL=0
  277. REM ignore the print out from ospl describing the location of the error log
  278. FindStr -i "error" %LOGFILE% | findstr /v "ospl-error.log"
  279. if %ERRORLEVEL% EQU 0 SET ERROR=1
  280. findstr /i /c:"timeout" %LOGFILE%
  281. if %ERRORLEVEL% EQU 0 SET TIMEOUT=1
  282. findstr /i /c:"NoCLassDefFound" %LOGFILE%
  283. if %ERRORLEVEL% EQU 0 SET NOCLASSDEFFOUND=1
  284. findstr /i /c:"assertion failed" %LOGFILE%
  285. if %ERRORLEVEL% EQU 0 SET ASSERTFAILED=1
  286. if %ERROR% EQU 1 SET FAIL=1
  287. if %TIMEOUT% EQU 1 SET FAIL=1
  288. if %NOCLASSDEFFOUND% EQU 1 SET FAIL=1
  289. if %ASSERTFAILED% EQU 1 SET FAIL=1
  290. if EXIST %OSPL_HOME%examples\%EXAMPLE%\ospl-error.log SET FAIL=1
  291. if EXIST %OSPL_HOME%examples\%EXAMPLE%\ospl-error.log echo ospl-error.log found for %EXAMPLE% >> %RUN_SUMMARY_LOG%
  292. findstr /c:"WARNING" %OSPL_HOME%examples\%EXAMPLE%\ospl-info.log
  293. if %ERRORLEVEL% EQU 0 SET FAIL=1
  294. findstr /c:"WARNING" %OSPL_HOME%examples\%EXAMPLE%\ospl-info.log
  295. if %ERRORLEVEL% EQU 0 echo WARNING found in ospl-info.log for %EXAMPLE% >> %RUN_SUMMARY_LOG%
  296. REM Append result to %LOGFILE%
  297. if %FAIL% EQU 1 (echo Run %EXAMPLE% FAILED >> %LOGFILE%) ELSE (echo Run %EXAMPLE% PASSED >> %LOGFILE%)
  298. REM Append result to %RUN_SUMMARY_LOG%
  299. if %FAIL% EQU 1 (echo Run %EXAMPLE% FAILED >> %RUN_SUMMARY_LOG%) ELSE (echo Run %EXAMPLE% PASSED >> %RUN_SUMMARY_LOG%)
  300. if %FAIL% EQU 1 (SET /A FAILURES += 1) ELSE ( SET /A PASS += 1)
  301. REM The following line creates a string which is used to create a directory to hold
  302. REM all the logs from the example run.
  303. echo %EXAMPLE% | sed "s/standalone/SA/; s/CORBA/C/; s/Java/J/; s/C++/CPP/; s/JacORB//; s/OpenFusion//; s/\///g;" > tmp.txt
  304. set /p EXAMPLELOGS= < tmp.txt
  305. mkdir %LOGDIR%\examples\run\%EXAMPLELOGS%
  306. cp *.log %LOGDIR%\examples\run\%EXAMPLELOGS%
  307. ECHO %EXAMPLE% run complete
  308. ECHO /////
  309. ECHO /////
  310. %SLEEP10% >NUL
  311. ECHO Next example is %NEXTEXAMPLE%
  312. GOTO %NEXTEXAMPLE%
  313. :END
  314. ECHO End of new examples