arduino_ci 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (306) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +203 -4
  3. data/cpp/arduino/Arduino.cpp +0 -21
  4. data/cpp/arduino/Arduino.h +0 -10
  5. data/cpp/arduino/ArduinoDefines.h +0 -1
  6. data/cpp/arduino/AvrMath.h +5 -6
  7. data/cpp/arduino/Godmode.cpp +26 -0
  8. data/cpp/arduino/Godmode.h +41 -19
  9. data/cpp/arduino/HardwareSerial.h +7 -3
  10. data/cpp/arduino/PinHistory.h +160 -0
  11. data/cpp/arduino/Print.h +4 -2
  12. data/cpp/arduino/SoftwareSerial.h +77 -0
  13. data/cpp/arduino/Stream.h +4 -1
  14. data/cpp/arduino/WString.h +15 -9
  15. data/cpp/arduino/{include → avr}/README.md +0 -0
  16. data/cpp/arduino/{include → avr}/common.h +0 -0
  17. data/cpp/arduino/{include → avr}/fuse.h +0 -0
  18. data/cpp/arduino/{include → avr}/io.h +0 -0
  19. data/cpp/arduino/{include → avr}/io1200.h +0 -0
  20. data/cpp/arduino/{include → avr}/io2313.h +0 -0
  21. data/cpp/arduino/{include → avr}/io2323.h +0 -0
  22. data/cpp/arduino/{include → avr}/io2333.h +0 -0
  23. data/cpp/arduino/{include → avr}/io2343.h +0 -0
  24. data/cpp/arduino/{include → avr}/io43u32x.h +0 -0
  25. data/cpp/arduino/{include → avr}/io43u35x.h +0 -0
  26. data/cpp/arduino/{include → avr}/io4414.h +0 -0
  27. data/cpp/arduino/{include → avr}/io4433.h +0 -0
  28. data/cpp/arduino/{include → avr}/io4434.h +0 -0
  29. data/cpp/arduino/{include → avr}/io76c711.h +0 -0
  30. data/cpp/arduino/{include → avr}/io8515.h +0 -0
  31. data/cpp/arduino/{include → avr}/io8534.h +0 -0
  32. data/cpp/arduino/{include → avr}/io8535.h +0 -0
  33. data/cpp/arduino/{include → avr}/io86r401.h +0 -0
  34. data/cpp/arduino/{include → avr}/io90pwm1.h +0 -0
  35. data/cpp/arduino/{include → avr}/io90pwm161.h +0 -0
  36. data/cpp/arduino/{include → avr}/io90pwm216.h +0 -0
  37. data/cpp/arduino/{include → avr}/io90pwm2b.h +0 -0
  38. data/cpp/arduino/{include → avr}/io90pwm316.h +0 -0
  39. data/cpp/arduino/{include → avr}/io90pwm3b.h +0 -0
  40. data/cpp/arduino/{include → avr}/io90pwm81.h +0 -0
  41. data/cpp/arduino/{include → avr}/io90pwmx.h +0 -0
  42. data/cpp/arduino/{include → avr}/io90scr100.h +0 -0
  43. data/cpp/arduino/{include → avr}/ioa5272.h +0 -0
  44. data/cpp/arduino/{include → avr}/ioa5505.h +0 -0
  45. data/cpp/arduino/{include → avr}/ioa5702m322.h +0 -0
  46. data/cpp/arduino/{include → avr}/ioa5782.h +0 -0
  47. data/cpp/arduino/{include → avr}/ioa5790.h +0 -0
  48. data/cpp/arduino/{include → avr}/ioa5790n.h +0 -0
  49. data/cpp/arduino/{include → avr}/ioa5791.h +0 -0
  50. data/cpp/arduino/{include → avr}/ioa5795.h +0 -0
  51. data/cpp/arduino/{include → avr}/ioa5831.h +0 -0
  52. data/cpp/arduino/{include → avr}/ioa6285.h +0 -0
  53. data/cpp/arduino/{include → avr}/ioa6286.h +0 -0
  54. data/cpp/arduino/{include → avr}/ioa6289.h +0 -0
  55. data/cpp/arduino/{include → avr}/ioa6612c.h +0 -0
  56. data/cpp/arduino/{include → avr}/ioa6613c.h +0 -0
  57. data/cpp/arduino/{include → avr}/ioa6614q.h +0 -0
  58. data/cpp/arduino/{include → avr}/ioa6616c.h +0 -0
  59. data/cpp/arduino/{include → avr}/ioa6617c.h +0 -0
  60. data/cpp/arduino/{include → avr}/ioa664251.h +0 -0
  61. data/cpp/arduino/{include → avr}/ioa8210.h +0 -0
  62. data/cpp/arduino/{include → avr}/ioa8510.h +0 -0
  63. data/cpp/arduino/{include → avr}/ioat94k.h +0 -0
  64. data/cpp/arduino/{include → avr}/iocan128.h +0 -0
  65. data/cpp/arduino/{include → avr}/iocan32.h +0 -0
  66. data/cpp/arduino/{include → avr}/iocan64.h +0 -0
  67. data/cpp/arduino/{include → avr}/iocanxx.h +0 -0
  68. data/cpp/arduino/{include → avr}/iom103.h +0 -0
  69. data/cpp/arduino/{include → avr}/iom128.h +0 -0
  70. data/cpp/arduino/{include → avr}/iom1280.h +0 -0
  71. data/cpp/arduino/{include → avr}/iom1281.h +0 -0
  72. data/cpp/arduino/{include → avr}/iom1284.h +0 -0
  73. data/cpp/arduino/{include → avr}/iom1284p.h +0 -0
  74. data/cpp/arduino/{include → avr}/iom1284rfr2.h +0 -0
  75. data/cpp/arduino/{include → avr}/iom128a.h +0 -0
  76. data/cpp/arduino/{include → avr}/iom128rfa1.h +0 -0
  77. data/cpp/arduino/{include → avr}/iom128rfr2.h +0 -0
  78. data/cpp/arduino/{include → avr}/iom16.h +0 -0
  79. data/cpp/arduino/{include → avr}/iom161.h +0 -0
  80. data/cpp/arduino/{include → avr}/iom162.h +0 -0
  81. data/cpp/arduino/{include → avr}/iom163.h +0 -0
  82. data/cpp/arduino/{include → avr}/iom164.h +0 -0
  83. data/cpp/arduino/{include → avr}/iom164a.h +0 -0
  84. data/cpp/arduino/{include → avr}/iom164p.h +0 -0
  85. data/cpp/arduino/{include → avr}/iom164pa.h +0 -0
  86. data/cpp/arduino/{include → avr}/iom165.h +0 -0
  87. data/cpp/arduino/{include → avr}/iom165a.h +0 -0
  88. data/cpp/arduino/{include → avr}/iom165p.h +0 -0
  89. data/cpp/arduino/{include → avr}/iom165pa.h +0 -0
  90. data/cpp/arduino/{include → avr}/iom168.h +0 -0
  91. data/cpp/arduino/{include → avr}/iom168a.h +0 -0
  92. data/cpp/arduino/{include → avr}/iom168p.h +0 -0
  93. data/cpp/arduino/{include → avr}/iom168pa.h +0 -0
  94. data/cpp/arduino/{include → avr}/iom168pb.h +0 -0
  95. data/cpp/arduino/{include → avr}/iom169.h +0 -0
  96. data/cpp/arduino/{include → avr}/iom169a.h +0 -0
  97. data/cpp/arduino/{include → avr}/iom169p.h +0 -0
  98. data/cpp/arduino/{include → avr}/iom169pa.h +0 -0
  99. data/cpp/arduino/{include → avr}/iom16a.h +0 -0
  100. data/cpp/arduino/{include → avr}/iom16hva.h +0 -0
  101. data/cpp/arduino/{include → avr}/iom16hva2.h +0 -0
  102. data/cpp/arduino/{include → avr}/iom16hvb.h +0 -0
  103. data/cpp/arduino/{include → avr}/iom16hvbrevb.h +0 -0
  104. data/cpp/arduino/{include → avr}/iom16m1.h +0 -0
  105. data/cpp/arduino/{include → avr}/iom16u2.h +0 -0
  106. data/cpp/arduino/{include → avr}/iom16u4.h +0 -0
  107. data/cpp/arduino/{include → avr}/iom2560.h +0 -0
  108. data/cpp/arduino/{include → avr}/iom2561.h +0 -0
  109. data/cpp/arduino/{include → avr}/iom2564rfr2.h +0 -0
  110. data/cpp/arduino/{include → avr}/iom256rfr2.h +0 -0
  111. data/cpp/arduino/{include → avr}/iom3000.h +0 -0
  112. data/cpp/arduino/{include → avr}/iom32.h +0 -0
  113. data/cpp/arduino/{include → avr}/iom323.h +0 -0
  114. data/cpp/arduino/{include → avr}/iom324a.h +0 -0
  115. data/cpp/arduino/{include → avr}/iom324p.h +0 -0
  116. data/cpp/arduino/{include → avr}/iom324pa.h +0 -0
  117. data/cpp/arduino/{include → avr}/iom325.h +0 -0
  118. data/cpp/arduino/{include → avr}/iom3250.h +0 -0
  119. data/cpp/arduino/{include → avr}/iom3250a.h +0 -0
  120. data/cpp/arduino/{include → avr}/iom3250p.h +0 -0
  121. data/cpp/arduino/{include → avr}/iom3250pa.h +0 -0
  122. data/cpp/arduino/{include → avr}/iom325a.h +0 -0
  123. data/cpp/arduino/{include → avr}/iom325p.h +0 -0
  124. data/cpp/arduino/{include → avr}/iom325pa.h +0 -0
  125. data/cpp/arduino/{include → avr}/iom328.h +0 -0
  126. data/cpp/arduino/{include → avr}/iom328p.h +0 -0
  127. data/cpp/arduino/{include → avr}/iom329.h +0 -0
  128. data/cpp/arduino/{include → avr}/iom3290.h +0 -0
  129. data/cpp/arduino/{include → avr}/iom3290a.h +0 -0
  130. data/cpp/arduino/{include → avr}/iom3290pa.h +0 -0
  131. data/cpp/arduino/{include → avr}/iom329a.h +0 -0
  132. data/cpp/arduino/{include → avr}/iom329p.h +0 -0
  133. data/cpp/arduino/{include → avr}/iom329pa.h +0 -0
  134. data/cpp/arduino/{include → avr}/iom32a.h +0 -0
  135. data/cpp/arduino/{include → avr}/iom32c1.h +0 -0
  136. data/cpp/arduino/{include → avr}/iom32hvb.h +0 -0
  137. data/cpp/arduino/{include → avr}/iom32hvbrevb.h +0 -0
  138. data/cpp/arduino/{include → avr}/iom32m1.h +0 -0
  139. data/cpp/arduino/{include → avr}/iom32u2.h +0 -0
  140. data/cpp/arduino/{include → avr}/iom32u4.h +0 -0
  141. data/cpp/arduino/{include → avr}/iom32u6.h +0 -0
  142. data/cpp/arduino/{include → avr}/iom406.h +0 -0
  143. data/cpp/arduino/{include → avr}/iom48.h +0 -0
  144. data/cpp/arduino/{include → avr}/iom48a.h +0 -0
  145. data/cpp/arduino/{include → avr}/iom48p.h +0 -0
  146. data/cpp/arduino/{include → avr}/iom48pa.h +0 -0
  147. data/cpp/arduino/{include → avr}/iom48pb.h +0 -0
  148. data/cpp/arduino/{include → avr}/iom64.h +0 -0
  149. data/cpp/arduino/{include → avr}/iom640.h +0 -0
  150. data/cpp/arduino/{include → avr}/iom644.h +0 -0
  151. data/cpp/arduino/{include → avr}/iom644a.h +0 -0
  152. data/cpp/arduino/{include → avr}/iom644p.h +0 -0
  153. data/cpp/arduino/{include → avr}/iom644pa.h +0 -0
  154. data/cpp/arduino/{include → avr}/iom644rfr2.h +0 -0
  155. data/cpp/arduino/{include → avr}/iom645.h +0 -0
  156. data/cpp/arduino/{include → avr}/iom6450.h +0 -0
  157. data/cpp/arduino/{include → avr}/iom6450a.h +0 -0
  158. data/cpp/arduino/{include → avr}/iom6450p.h +0 -0
  159. data/cpp/arduino/{include → avr}/iom645a.h +0 -0
  160. data/cpp/arduino/{include → avr}/iom645p.h +0 -0
  161. data/cpp/arduino/{include → avr}/iom649.h +0 -0
  162. data/cpp/arduino/{include → avr}/iom6490.h +0 -0
  163. data/cpp/arduino/{include → avr}/iom6490a.h +0 -0
  164. data/cpp/arduino/{include → avr}/iom6490p.h +0 -0
  165. data/cpp/arduino/{include → avr}/iom649a.h +0 -0
  166. data/cpp/arduino/{include → avr}/iom649p.h +0 -0
  167. data/cpp/arduino/{include → avr}/iom64a.h +0 -0
  168. data/cpp/arduino/{include → avr}/iom64c1.h +0 -0
  169. data/cpp/arduino/{include → avr}/iom64hve.h +0 -0
  170. data/cpp/arduino/{include → avr}/iom64hve2.h +0 -0
  171. data/cpp/arduino/{include → avr}/iom64m1.h +0 -0
  172. data/cpp/arduino/{include → avr}/iom64rfr2.h +0 -0
  173. data/cpp/arduino/{include → avr}/iom8.h +0 -0
  174. data/cpp/arduino/{include → avr}/iom8515.h +0 -0
  175. data/cpp/arduino/{include → avr}/iom8535.h +0 -0
  176. data/cpp/arduino/{include → avr}/iom88.h +0 -0
  177. data/cpp/arduino/{include → avr}/iom88a.h +0 -0
  178. data/cpp/arduino/{include → avr}/iom88p.h +0 -0
  179. data/cpp/arduino/{include → avr}/iom88pa.h +0 -0
  180. data/cpp/arduino/{include → avr}/iom88pb.h +0 -0
  181. data/cpp/arduino/{include → avr}/iom8a.h +0 -0
  182. data/cpp/arduino/{include → avr}/iom8hva.h +0 -0
  183. data/cpp/arduino/{include → avr}/iom8u2.h +0 -0
  184. data/cpp/arduino/{include → avr}/iomx8.h +0 -0
  185. data/cpp/arduino/{include → avr}/iomxx0_1.h +0 -0
  186. data/cpp/arduino/{include → avr}/iomxx4.h +0 -0
  187. data/cpp/arduino/{include → avr}/iomxxhva.h +0 -0
  188. data/cpp/arduino/{include → avr}/iotn10.h +0 -0
  189. data/cpp/arduino/{include → avr}/iotn11.h +0 -0
  190. data/cpp/arduino/{include → avr}/iotn12.h +0 -0
  191. data/cpp/arduino/{include → avr}/iotn13.h +0 -0
  192. data/cpp/arduino/{include → avr}/iotn13a.h +0 -0
  193. data/cpp/arduino/{include → avr}/iotn15.h +0 -0
  194. data/cpp/arduino/{include → avr}/iotn1634.h +0 -0
  195. data/cpp/arduino/{include → avr}/iotn167.h +0 -0
  196. data/cpp/arduino/{include → avr}/iotn20.h +0 -0
  197. data/cpp/arduino/{include → avr}/iotn22.h +0 -0
  198. data/cpp/arduino/{include → avr}/iotn2313.h +0 -0
  199. data/cpp/arduino/{include → avr}/iotn2313a.h +0 -0
  200. data/cpp/arduino/{include → avr}/iotn24.h +0 -0
  201. data/cpp/arduino/{include → avr}/iotn24a.h +0 -0
  202. data/cpp/arduino/{include → avr}/iotn25.h +0 -0
  203. data/cpp/arduino/{include → avr}/iotn26.h +0 -0
  204. data/cpp/arduino/{include → avr}/iotn261.h +0 -0
  205. data/cpp/arduino/{include → avr}/iotn261a.h +0 -0
  206. data/cpp/arduino/{include → avr}/iotn28.h +0 -0
  207. data/cpp/arduino/{include → avr}/iotn4.h +0 -0
  208. data/cpp/arduino/{include → avr}/iotn40.h +0 -0
  209. data/cpp/arduino/{include → avr}/iotn4313.h +0 -0
  210. data/cpp/arduino/{include → avr}/iotn43u.h +0 -0
  211. data/cpp/arduino/{include → avr}/iotn44.h +0 -0
  212. data/cpp/arduino/{include → avr}/iotn441.h +0 -0
  213. data/cpp/arduino/{include → avr}/iotn44a.h +0 -0
  214. data/cpp/arduino/{include → avr}/iotn45.h +0 -0
  215. data/cpp/arduino/{include → avr}/iotn461.h +0 -0
  216. data/cpp/arduino/{include → avr}/iotn461a.h +0 -0
  217. data/cpp/arduino/{include → avr}/iotn48.h +0 -0
  218. data/cpp/arduino/{include → avr}/iotn5.h +0 -0
  219. data/cpp/arduino/{include → avr}/iotn828.h +0 -0
  220. data/cpp/arduino/{include → avr}/iotn84.h +0 -0
  221. data/cpp/arduino/{include → avr}/iotn841.h +0 -0
  222. data/cpp/arduino/{include → avr}/iotn84a.h +0 -0
  223. data/cpp/arduino/{include → avr}/iotn85.h +0 -0
  224. data/cpp/arduino/{include → avr}/iotn861.h +0 -0
  225. data/cpp/arduino/{include → avr}/iotn861a.h +0 -0
  226. data/cpp/arduino/{include → avr}/iotn87.h +0 -0
  227. data/cpp/arduino/{include → avr}/iotn88.h +0 -0
  228. data/cpp/arduino/{include → avr}/iotn9.h +0 -0
  229. data/cpp/arduino/{include → avr}/iotnx4.h +0 -0
  230. data/cpp/arduino/{include → avr}/iotnx5.h +0 -0
  231. data/cpp/arduino/{include → avr}/iotnx61.h +0 -0
  232. data/cpp/arduino/{include → avr}/iousb1286.h +0 -0
  233. data/cpp/arduino/{include → avr}/iousb1287.h +0 -0
  234. data/cpp/arduino/{include → avr}/iousb162.h +0 -0
  235. data/cpp/arduino/{include → avr}/iousb646.h +0 -0
  236. data/cpp/arduino/{include → avr}/iousb647.h +0 -0
  237. data/cpp/arduino/{include → avr}/iousb82.h +0 -0
  238. data/cpp/arduino/{include → avr}/iousbxx2.h +0 -0
  239. data/cpp/arduino/{include → avr}/iousbxx6_7.h +0 -0
  240. data/cpp/arduino/{include → avr}/iox128a1.h +0 -0
  241. data/cpp/arduino/{include → avr}/iox128a1u.h +0 -0
  242. data/cpp/arduino/{include → avr}/iox128a3.h +0 -0
  243. data/cpp/arduino/{include → avr}/iox128a3u.h +0 -0
  244. data/cpp/arduino/{include → avr}/iox128a4u.h +0 -0
  245. data/cpp/arduino/{include → avr}/iox128b1.h +0 -0
  246. data/cpp/arduino/{include → avr}/iox128b3.h +0 -0
  247. data/cpp/arduino/{include → avr}/iox128c3.h +0 -0
  248. data/cpp/arduino/{include → avr}/iox128d3.h +0 -0
  249. data/cpp/arduino/{include → avr}/iox128d4.h +0 -0
  250. data/cpp/arduino/{include → avr}/iox16a4.h +0 -0
  251. data/cpp/arduino/{include → avr}/iox16a4u.h +0 -0
  252. data/cpp/arduino/{include → avr}/iox16c4.h +0 -0
  253. data/cpp/arduino/{include → avr}/iox16d4.h +0 -0
  254. data/cpp/arduino/{include → avr}/iox16e5.h +0 -0
  255. data/cpp/arduino/{include → avr}/iox192a3.h +0 -0
  256. data/cpp/arduino/{include → avr}/iox192a3u.h +0 -0
  257. data/cpp/arduino/{include → avr}/iox192c3.h +0 -0
  258. data/cpp/arduino/{include → avr}/iox192d3.h +0 -0
  259. data/cpp/arduino/{include → avr}/iox256a3.h +0 -0
  260. data/cpp/arduino/{include → avr}/iox256a3b.h +0 -0
  261. data/cpp/arduino/{include → avr}/iox256a3bu.h +0 -0
  262. data/cpp/arduino/{include → avr}/iox256a3u.h +0 -0
  263. data/cpp/arduino/{include → avr}/iox256c3.h +0 -0
  264. data/cpp/arduino/{include → avr}/iox256d3.h +0 -0
  265. data/cpp/arduino/{include → avr}/iox32a4.h +0 -0
  266. data/cpp/arduino/{include → avr}/iox32a4u.h +0 -0
  267. data/cpp/arduino/{include → avr}/iox32c3.h +0 -0
  268. data/cpp/arduino/{include → avr}/iox32c4.h +0 -0
  269. data/cpp/arduino/{include → avr}/iox32d3.h +0 -0
  270. data/cpp/arduino/{include → avr}/iox32d4.h +0 -0
  271. data/cpp/arduino/{include → avr}/iox32e5.h +0 -0
  272. data/cpp/arduino/{include → avr}/iox384c3.h +0 -0
  273. data/cpp/arduino/{include → avr}/iox384d3.h +0 -0
  274. data/cpp/arduino/{include → avr}/iox64a1.h +0 -0
  275. data/cpp/arduino/{include → avr}/iox64a1u.h +0 -0
  276. data/cpp/arduino/{include → avr}/iox64a3.h +0 -0
  277. data/cpp/arduino/{include → avr}/iox64a3u.h +0 -0
  278. data/cpp/arduino/{include → avr}/iox64a4u.h +0 -0
  279. data/cpp/arduino/{include → avr}/iox64b1.h +0 -0
  280. data/cpp/arduino/{include → avr}/iox64b3.h +0 -0
  281. data/cpp/arduino/{include → avr}/iox64c3.h +0 -0
  282. data/cpp/arduino/{include → avr}/iox64d3.h +0 -0
  283. data/cpp/arduino/{include → avr}/iox64d4.h +0 -0
  284. data/cpp/arduino/{include → avr}/iox8e5.h +0 -0
  285. data/cpp/arduino/{include → avr}/lock.h +0 -0
  286. data/cpp/arduino/avr/pgmspace.h +94 -0
  287. data/cpp/arduino/{include → avr}/portpins.h +0 -0
  288. data/cpp/arduino/{include → avr}/version.h +0 -0
  289. data/cpp/arduino/{include → avr}/xmega.h +0 -0
  290. data/cpp/arduino/binary.h +1 -0
  291. data/cpp/arduino/ci/DeviceUsingBytes.h +56 -0
  292. data/cpp/arduino/ci/ObservableDataStream.h +124 -0
  293. data/cpp/arduino/ci/Queue.h +73 -0
  294. data/cpp/arduino/ci/README.md +5 -0
  295. data/cpp/arduino/ci/Table.h +125 -0
  296. data/cpp/unittest/ArduinoUnitTests.h +16 -16
  297. data/cpp/unittest/Assertion.h +2 -2
  298. data/cpp/unittest/Compare.h +1 -1
  299. data/exe/arduino_ci_remote.rb +34 -21
  300. data/lib/arduino_ci/arduino_cmd.rb +1 -0
  301. data/lib/arduino_ci/arduino_installation.rb +13 -19
  302. data/lib/arduino_ci/ci_config.rb +42 -10
  303. data/lib/arduino_ci/cpp_library.rb +6 -1
  304. data/lib/arduino_ci/version.rb +1 -1
  305. data/misc/{default.yaml → default.yml} +0 -0
  306. metadata +285 -277
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b23f7b008729652fa65a7e3ed99bd86e703d847ccb13b56d8483eb557242633c
4
- data.tar.gz: bcb9729486d9326e45cb07b8f3c61311f9fd61290460548c0d6130eb7986a521
3
+ metadata.gz: 1553aff5cd187c7db5ea325fd2ee878914fae57692d70042f1ceb0a6cd184f18
4
+ data.tar.gz: 8c948d1eec2967ee364fc2fa983bed1746dc1204089d2ea0f355ab27b0aa97f6
5
5
  SHA512:
6
- metadata.gz: 047e0f22cfc56a8802817ef49f5bac03c6037b755d4d36651661a7bba0a46590765867233f8c8e488cc414180dee89e385745e788036558a1eff04c1216f90cc
7
- data.tar.gz: 962d9c99d23d4bb341663cc1a3b222f3272badbcffdf774c7efce449e930fbafc2be3a55d27e1edabc0d09066bf94575e5d19e1d147355fe60bcf7ede38b46e8
6
+ metadata.gz: 43bbc201c5d38e8852a71e3a0b4da85400d764fc2e4b248e0fd14f6d79c1111c4bc778aecdc7e49bea8c7c73e4417b28f4ae9d3e5c3ba4814768929bf5ae2c7b
7
+ data.tar.gz: '069ce22a67dc335c5b1d97bdecc91476bf8f6484740b9acfd063e4c2741db0cfa808c5b5599dce970721f2d808825ebf0297857e88fe7a75bfa2611a4cda23bf'
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  [![Gem Version](https://badge.fury.io/rb/arduino_ci.svg)](https://rubygems.org/gems/arduino_ci)
2
2
  [![Build Status](https://travis-ci.org/ifreecarve/arduino_ci.svg)](https://travis-ci.org/ifreecarve/arduino_ci)
3
- [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.4)
3
+ [![Documentation](http://img.shields.io/badge/docs-rdoc.info-blue.svg)](http://www.rubydoc.info/gems/arduino_ci/0.1.5)
4
4
 
5
5
  # ArduinoCI Ruby gem (`arduino_ci`)
6
6
 
@@ -28,6 +28,8 @@ script:
28
28
 
29
29
  That's literally all there is to it on the repository side. You'll need to go to https://travis-ci.org/profile/ and enable testing for your Arduino project. Once that happens, you should be all set. The script will test all example projects of the library and all unit tests.
30
30
 
31
+ > **Note:** `arduino_ci_remote.rb` expects to be run from the root directory of your Arduino project library.
32
+
31
33
  ### Unit tests in `test/`
32
34
 
33
35
  All `.cpp` files in the `test/` directory of your Arduino library are assumed to contain unit tests. Each and every one will be compiled and executed on its own.
@@ -61,13 +63,85 @@ unittest(example_godmode_stuff)
61
63
  state->resetClock(); // - you can reset just the clock (to zero)
62
64
  state->resetPins(); // - or just the pins
63
65
  state->micros = 1; // manually set the clock such that micros() returns 1
64
- state->digitalPin[4]; // stores the commanded state of digital pin 4
66
+ state->digitalPin[4]; // tells you the commanded state of digital pin 4
65
67
  state->digitalPin[4] = HIGH; // digitalRead(4) will now return HIGH
66
- state->analogPin[3]; // stores the commanded state of analog pin 3
68
+ state->analogPin[3]; // tells you the commanded state of analog pin 3
67
69
  state->analogPin[3] = 99; // analogRead(3) will now return 99
68
70
  }
69
71
  ```
70
72
 
73
+ #### Pin Histories
74
+
75
+ Of course, it's possible that your code might flip the bit more than once in a function. For that scenario, you may want to examine the history of a pin's commanded outputs:
76
+
77
+ ```C++
78
+ unittest(pin_history)
79
+ {
80
+ GodmodeState* state = GODMODE();
81
+ int myPin = 3;
82
+ state->reset(); // pin will start LOW
83
+ digitalWrite(myPin, HIGH);
84
+ digitalWrite(myPin, LOW);
85
+ digitalWrite(myPin, LOW);
86
+ digitalWrite(myPin, HIGH);
87
+ digitalWrite(myPin, HIGH);
88
+
89
+ assertEqual(6, state->digitalPin[1].size());
90
+ bool expected[6] = {LOW, HIGH, LOW, LOW, HIGH, HIGH};
91
+ bool actual[6];
92
+
93
+ // move history queue into an array because at the moment, reading
94
+ // the history is destructive -- it's a linked-list queue. this
95
+ // means that if toArray or hasElements fails, the queue will be in
96
+ // an unknown state and you should reset it before continuing with
97
+ // other tests
98
+ int numMoved = state->digitalPin[myPin].toArray(actual, 6);
99
+ assertEqual(6, numMoved);
100
+
101
+ // verify each element
102
+ for (int i = 0; i < 6; ++i) {
103
+ assertEqual(expected[i], actual[i]);
104
+ }
105
+ ```
106
+
107
+
108
+ #### Pin Futures
109
+
110
+ Reading the pin more than once per function is also a possibility. In that case, we want to queue up a few values for the `digitalRead` or `analogRead` to find.
111
+
112
+ ```C++
113
+ unittest(pin_read_history)
114
+ {
115
+ GodmodeState* state = GODMODE();
116
+ state->reset();
117
+
118
+ int future[6] = {33, 22, 55, 11, 44, 66};
119
+ state->analogPin[1].fromArray(future, 6);
120
+ for (int i = 0; i < 6; ++i)
121
+ {
122
+ assertEqual(future[i], analogRead(1));
123
+ }
124
+
125
+ // for digital pins, we have the added possibility of specifying
126
+ // a stream of input bytes encoded as ASCII
127
+ bool bigEndian = true;
128
+ state->digitalPin[1].fromAscii("Yo", bigEndian);
129
+
130
+ // digitial history as serial data, big-endian
131
+ bool expectedBits[16] = {
132
+ 0, 1, 0, 1, 1, 0, 0, 1, // Y
133
+ 0, 1, 1, 0, 1, 1, 1, 1 // o
134
+ };
135
+
136
+ for (int i = 0; i < 16; ++i) {
137
+ assertEqual(expectedBits[i], digitalRead(1));
138
+ }
139
+ }
140
+ ```
141
+
142
+ #### Serial Data
143
+
144
+
71
145
  A more complicated example: working with serial port IO. Let's say I have the following function:
72
146
 
73
147
  ```C++
@@ -125,6 +199,132 @@ unittest(two_flips)
125
199
  }
126
200
  ```
127
201
 
202
+ #### Pin History as ASCII
203
+
204
+
205
+ For additional complexity, there are some cases where you want to use a pin as a serial port. There are history functions for that too.
206
+
207
+ ```C++
208
+ int myPin = 3;
209
+
210
+ // digitial history as serial data, big-endian
211
+ bool bigEndian = true;
212
+ bool binaryAscii[24] = {
213
+ 0, 1, 0, 1, 1, 0, 0, 1, // Y
214
+ 0, 1, 1, 0, 0, 1, 0, 1, // e
215
+ 0, 1, 1, 1, 0, 0, 1, 1 // s
216
+ };
217
+
218
+ // "send" these bits
219
+ for (int i = 0; i < 24; digitalWrite(myPin, binaryAscii[i++]));
220
+
221
+ // The first bit in the history is the initial value, which we will ignore
222
+ int offset = 1;
223
+
224
+ // We should be able to parse the bits as ascii
225
+ assertEqual("Yes", state->digitalPin[myPin].toAscii(offset, bigEndian));
226
+ ```
227
+
228
+ Instead of queueing bits as ASCII for future use with `toAscii`, you can send those bits directly (and immediately) to the output using `outgoingFromAscii`. Likewise, you can reinterpret/examine (as ASCII) the bits you have previously queued up by calling `incomingToAscii` on the PinHistory object.
229
+
230
+
231
+ #### Interactivity of "Devices" with Observers
232
+
233
+ Even pin history and input/output buffers aren't capable of testing interactive code. For example, queueing the canned responses from a serial device before the requests are even sent to it is not a sane test environment; the library under test will see the entire future waiting for it on the input pin instead of a buffer that fills and empties over time. This calls for something more complicated.
234
+
235
+ In this example, we create a simple class to emulate a Hayes modem. (For more information, dig into the `DataStreamObserver` code on which `DeviceUsingBytes` is based.
236
+
237
+ ```c++
238
+ class FakeHayesModem : public DeviceUsingBytes {
239
+ public:
240
+ String mLast;
241
+
242
+ FakeHayesModem() : DeviceUsingBytes() {
243
+ mLast = "";
244
+ addResponseLine("AT", "OK");
245
+ addResponseLine("ATV1", "NO CARRIER");
246
+ }
247
+ virtual ~FakeHayesModem() {}
248
+ virtual void onMatchInput(String output) { mLast = output; }
249
+ };
250
+
251
+ unittest(modem_hardware)
252
+ {
253
+ GodmodeState* state = GODMODE();
254
+ state->reset();
255
+ FakeHayesModem m;
256
+ m.attach(&Serial);
257
+
258
+ Serial.write("AT\n");
259
+ assertEqual("AT\n", state->serialPort[0].dataOut);
260
+ assertEqual("OK\n", m.mLast);
261
+ }
262
+ ```
263
+
264
+ Note that instead of setting `mLast = output` in the `onMatchInput()` function for test purposes, we could just as easily queue some bytes to state->serialPort[0].dataIn for the library under test to find on its next `peek()` or `read()`. Or we could execute some action on a digital or analog input pin; the possibilities are fairly endless in this regard, although you will have to define them yourself -- from scratch -- extending the `DataStreamObserver` class to emulate your physical device.
265
+
266
+
267
+ ## Overriding default build behavior
268
+
269
+ You can add `.arduino-ci.yml` files to the project directory (which will then apply to both `test/` and `examples/`), as well as to the `test/` directory and each example directory in `examples/`. All defined fields can be overridden.
270
+
271
+ You may define new platforms, or edit existing platform definitions:
272
+
273
+ ```yaml
274
+ platforms:
275
+ bogo:
276
+ board: fakeduino:beep:bogo
277
+ package: potato:salad
278
+ gcc:
279
+ features:
280
+ - omit-frame-pointer # becomes -fomit-frame-pointer flag
281
+ defines:
282
+ - HAVE_THING # becomes -DHAVE_THING flag
283
+ warnings:
284
+ - no-implicit # becomes -Wno-implicit flag
285
+ flags:
286
+ - -foobar # becomes -foobar flag
287
+
288
+ zero: ~ # undefines the `zero` board completely
289
+
290
+ esp8266: # redefines the existing esp8266
291
+ board: esp8266:esp8266:booo
292
+ package: esp8266:esp8266
293
+ gcc:
294
+ features:
295
+ defines:
296
+ warnings:
297
+ flags:
298
+ ```
299
+
300
+
301
+ For your example programs, you may set external libraries to be installed and included. You may also choose the platforms on which the compilation will be attempted:
302
+
303
+ ```yaml
304
+ compile:
305
+ libraries:
306
+ - "Adafruit FONA Library"
307
+ platforms:
308
+ - esp8266
309
+ ```
310
+
311
+
312
+ For your unit tests, in addition to setting specific libraries and platforms, you may filter the list of test files that are compiled and tested. This may help speed up targeted testing.
313
+
314
+ ```yaml
315
+ unittest:
316
+ testfiles:
317
+ select:
318
+ - "*-*.*"
319
+ reject:
320
+ - "sam-squamsh.*"
321
+ libraries:
322
+ - "abc123"
323
+ - "def456"
324
+ platforms:
325
+ - bogo
326
+ ```
327
+
128
328
  ## More Documentation
129
329
 
130
330
  This software is in alpha. But [SampleProjects/DoSomething](SampleProjects/DoSomething) has a decent writeup and is a good bare-bones example of all the features.
@@ -133,7 +333,6 @@ This software is in alpha. But [SampleProjects/DoSomething](SampleProjects/DoSo
133
333
 
134
334
  * The Arduino library is not fully mocked.
135
335
  * I don't have preprocessor defines for all the Arduino board flavors
136
- * Arduino Zero boards don't work in CI. I'm confused.
137
336
  * https://github.com/ifreecarve/arduino_ci/issues
138
337
 
139
338
 
@@ -1,23 +1,2 @@
1
- #include "Arduino.h"
2
1
  #include "Godmode.h"
3
2
 
4
-
5
- void digitalWrite(unsigned char pin, unsigned char val) {
6
- GodmodeState* godmode = GODMODE();
7
- godmode->digitalPin[pin] = val;
8
- }
9
-
10
- int digitalRead(unsigned char pin) {
11
- GodmodeState* godmode = GODMODE();
12
- return godmode->digitalPin[pin];
13
- }
14
-
15
- int analogRead(unsigned char pin) {
16
- GodmodeState* godmode = GODMODE();
17
- return godmode->analogPin[pin];
18
- }
19
-
20
- void analogWrite(unsigned char pin, int val) {
21
- GodmodeState* godmode = GODMODE();
22
- godmode->analogPin[pin] = val;
23
- }
@@ -57,16 +57,6 @@ typedef unsigned int word;
57
57
 
58
58
  #define bit(b) (1UL << (b))
59
59
 
60
- // io pins
61
- #define pinMode(...) _NOP()
62
- #define analogReference(...) _NOP()
63
-
64
- void digitalWrite(uint8_t, uint8_t);
65
- int digitalRead(uint8_t);
66
- int analogRead(uint8_t);
67
- void analogWrite(uint8_t, int);
68
- #define analogReadResolution(...) _NOP()
69
- #define analogWriteResolution(...) _NOP()
70
60
 
71
61
 
72
62
  /*
@@ -87,4 +87,3 @@
87
87
  #define TIMER5B 17
88
88
  #define TIMER5C 18
89
89
 
90
- #include "include/io.h"
@@ -4,6 +4,11 @@
4
4
  #define constrain(x,l,h) ((x)<(l)?(l):((x)>(h)?(h):(x)))
5
5
  #define map(x,inMin,inMax,outMin,outMax) (((x)-(inMin))*((outMax)-(outMin))/((inMax)-(inMin))+outMin)
6
6
 
7
+ #define sq(x) ((x)*(x))
8
+
9
+ #define radians(deg) ((deg)*DEG_TO_RAD)
10
+ #define degrees(rad) ((rad)*RAD_TO_DEG)
11
+
7
12
  #ifdef abs
8
13
  #undef abs
9
14
  #endif
@@ -19,9 +24,3 @@
19
24
  #endif
20
25
  #define min(a,b) ((a)<(b)?(a):(b))
21
26
 
22
- #define sq(x) ((x)*(x))
23
-
24
- #define radians(deg) ((deg)*DEG_TO_RAD)
25
- #define degrees(rad) ((rad)*RAD_TO_DEG)
26
-
27
-
@@ -46,6 +46,27 @@ long random(long vmin, long vmax)
46
46
  return vmin < vmax ? (random(vmax - vmin) + vmin) : vmin;
47
47
  }
48
48
 
49
+ void digitalWrite(unsigned char pin, unsigned char val) {
50
+ GodmodeState* godmode = GODMODE();
51
+ godmode->digitalPin[pin] = val;
52
+ }
53
+
54
+ int digitalRead(unsigned char pin) {
55
+ GodmodeState* godmode = GODMODE();
56
+ return godmode->digitalPin[pin].retrieve();
57
+ }
58
+
59
+ void analogWrite(unsigned char pin, int val) {
60
+ GodmodeState* godmode = GODMODE();
61
+ godmode->analogPin[pin] = val;
62
+ }
63
+
64
+ int analogRead(unsigned char pin) {
65
+ GodmodeState* godmode = GODMODE();
66
+ return godmode->analogPin[pin].retrieve();
67
+ }
68
+
69
+
49
70
  // Serial ports
50
71
  #if defined(HAVE_HWSERIAL0)
51
72
  HardwareSerial Serial(&godmode.serialPort[0].dataIn, &godmode.serialPort[0].dataOut, &godmode.serialPort[0].readDelayMicros);
@@ -60,3 +81,8 @@ long random(long vmin, long vmax)
60
81
  HardwareSerial Serial3(&godmode.serialPort[3].dataIn, &godmode.serialPort[3].dataOut, &godmode.serialPort[3].readDelayMicros);
61
82
  #endif
62
83
 
84
+ template <typename T>
85
+ inline std::ostream& operator << ( std::ostream& out, const PinHistory<T>& ph ) {
86
+ out << ph;
87
+ return out;
88
+ }
@@ -1,6 +1,21 @@
1
1
  #pragma once
2
2
  #include "ArduinoDefines.h"
3
+ #include <avr/io.h>
3
4
  #include "WString.h"
5
+ #include "PinHistory.h"
6
+
7
+ // random
8
+ void randomSeed(unsigned long seed);
9
+ long random(long vmax);
10
+ long random(long vmin, long vmax);
11
+
12
+
13
+ // Time
14
+ void delay(unsigned long millis);
15
+ void delayMicroseconds(unsigned long micros);
16
+ unsigned long millis();
17
+ unsigned long micros();
18
+
4
19
 
5
20
  #define MOCK_PINS_COUNT 256
6
21
 
@@ -16,7 +31,6 @@
16
31
  #define NUM_SERIAL_PORTS 0
17
32
  #endif
18
33
 
19
-
20
34
  class GodmodeState {
21
35
  struct PortDef {
22
36
  String dataIn;
@@ -28,14 +42,14 @@ class GodmodeState {
28
42
  unsigned long micros;
29
43
  unsigned long seed;
30
44
  // not going to put pinmode here unless its really needed. can't think of why it would be
31
- bool digitalPin[MOCK_PINS_COUNT];
32
- int analogPin[MOCK_PINS_COUNT];
45
+ PinHistory<bool> digitalPin[MOCK_PINS_COUNT];
46
+ PinHistory<int> analogPin[MOCK_PINS_COUNT];
33
47
  struct PortDef serialPort[NUM_SERIAL_PORTS];
34
48
 
35
49
  void resetPins() {
36
50
  for (int i = 0; i < MOCK_PINS_COUNT; ++i) {
37
- digitalPin[i] = LOW;
38
- analogPin[i] = 0;
51
+ digitalPin[i].reset(LOW);
52
+ analogPin[i].reset(0);
39
53
  }
40
54
  }
41
55
 
@@ -49,26 +63,34 @@ class GodmodeState {
49
63
  seed = 1;
50
64
  }
51
65
 
52
- GodmodeState() {
66
+ int serialPorts() {
67
+ return NUM_SERIAL_PORTS;
68
+ }
69
+
70
+ GodmodeState()
71
+ {
53
72
  reset();
54
- for (int i = 0; i < NUM_SERIAL_PORTS; ++i) {
55
- serialPort[i] = {"", "", 0};
73
+ for (int i = 0; i < serialPorts(); ++i)
74
+ {
75
+ serialPort[i].dataIn = "";
76
+ serialPort[i].dataOut = "";
77
+ serialPort[i].readDelayMicros = 0;
56
78
  }
57
- }
79
+ }
58
80
 
59
81
  };
60
82
 
61
- GodmodeState* GODMODE();
83
+ // io pins
84
+ #define pinMode(...) _NOP()
85
+ #define analogReference(...) _NOP()
62
86
 
63
- // random
64
- void randomSeed(unsigned long seed);
65
- long random(long vmax);
66
- long random(long vmin, long vmax);
87
+ void digitalWrite(uint8_t, uint8_t);
88
+ int digitalRead(uint8_t);
89
+ int analogRead(uint8_t);
90
+ void analogWrite(uint8_t, int);
91
+ #define analogReadResolution(...) _NOP()
92
+ #define analogWriteResolution(...) _NOP()
67
93
 
68
94
 
69
- // Time
70
- void delay(unsigned long millis);
71
- void delayMicroseconds(unsigned long micros);
72
- unsigned long millis();
73
- unsigned long micros();
95
+ GodmodeState* GODMODE();
74
96