|
| 1 | +## Integration test for the RPC library |
| 2 | + |
| 3 | +This is a test that runs on the Arduino Zero board. It could be easily extended to other boards with multiple serial ports. |
| 4 | + |
| 5 | +### Running the test |
| 6 | + |
| 7 | +Prerequisites: |
| 8 | + |
| 9 | +* An Arduino Zero board, connected with both the USB ports. |
| 10 | +* `arduino-cli` |
| 11 | +* The platform `arduino:samd` installed through the `arduino-cli`. |
| 12 | +* The dependencies of the RPClite library installed through the `arduino-cli`. |
| 13 | +* A working `go` programming language compiler. |
| 14 | + |
| 15 | +To run the test, from a terminal change directory to this folder, and run: |
| 16 | + |
| 17 | +`go test -v` |
| 18 | + |
| 19 | +it should compile and upload the test sketch, and perform the RPC call tests. |
| 20 | + |
| 21 | +The output should look similar to the following: |
| 22 | + |
| 23 | +``` |
| 24 | +RpcLite/test/RpcClientTest$ go test -v |
| 25 | +=== RUN TestBasicComm |
| 26 | +Lo sketch usa 27028 byte (10%) dello spazio disponibile per i programmi. Il massimo è 262144 byte. |
| 27 | +Le variabili globali usano 4040 byte (12%) di memoria dinamica, lasciando altri 28728 byte liberi per le variabili locali. Il massimo è 32768 byte. |
| 28 | +Atmel SMART device 0x10010005 found |
| 29 | +Device : ATSAMD21G18A |
| 30 | +Chip ID : 10010005 |
| 31 | +Version : v2.0 [Arduino:XYZ] Apr 11 2019 13:09:49 |
| 32 | +Address : 8192 |
| 33 | +Pages : 3968 |
| 34 | +Page Size : 64 bytes |
| 35 | +Total Size : 248KB |
| 36 | +Planes : 1 |
| 37 | +Lock Regions : 16 |
| 38 | +Locked : none |
| 39 | +Security : false |
| 40 | +Boot Flash : true |
| 41 | +BOD : true |
| 42 | +BOR : true |
| 43 | +Arduino : FAST_CHIP_ERASE |
| 44 | +Arduino : FAST_MULTI_PAGE_WRITE |
| 45 | +Arduino : CAN_CHECKSUM_MEMORY_BUFFER |
| 46 | +Erase flash |
| 47 | +done in 0.873 seconds |
| 48 | +
|
| 49 | +Write 27028 bytes to flash (423 pages) |
| 50 | +[==============================] 100% (423/423 pages) |
| 51 | +done in 0.155 seconds |
| 52 | +
|
| 53 | +Verify 27028 bytes of flash with checksum. |
| 54 | +Verify successful |
| 55 | +done in 0.026 seconds |
| 56 | +CPU reset. |
| 57 | +=== RUN TestBasicComm/RPCClientCallFloatArgs |
| 58 | +/dev/ttyACM0 READ << 94 |
| 59 | +/dev/ttyACM0 READ << 0001 |
| 60 | +/dev/ttyACM0 READ << a4 |
| 61 | +/dev/ttyACM0 READ << 6d75 |
| 62 | +/dev/ttyACM0 READ << 6c |
| 63 | +/dev/ttyACM0 READ << 74 |
| 64 | +/dev/ttyACM0 READ << 92cb |
| 65 | +/dev/ttyACM0 READ << 40 |
| 66 | +/dev/ttyACM0 READ << 0000 |
| 67 | +/dev/ttyACM0 READ << 00 |
| 68 | +/dev/ttyACM0 READ << 0000 |
| 69 | +/dev/ttyACM0 READ << 00 |
| 70 | +/dev/ttyACM0 READ << 00cb |
| 71 | +/dev/ttyACM0 READ << 40 |
| 72 | +/dev/ttyACM0 READ << 08 |
| 73 | +/dev/ttyACM0 READ << 0000 |
| 74 | +/dev/ttyACM0 READ << 00 |
| 75 | +/dev/ttyACM0 READ << 0000 |
| 76 | +/dev/ttyACM0 READ << 00 |
| 77 | +/dev/ttyACM0 WRITE >> 94 |
| 78 | +/dev/ttyACM0 WRITE >> 01 |
| 79 | +/dev/ttyACM0 WRITE >> 01 |
| 80 | +/dev/ttyACM0 WRITE >> c0 |
| 81 | +/dev/ttyACM0 WRITE >> cb4018000000000000 |
| 82 | +=== RUN TestBasicComm/RPCClientCallFloatArgsError |
| 83 | +/dev/ttyACM0 READ << 9400 |
| 84 | +/dev/ttyACM0 READ << 02a46d |
| 85 | +/dev/ttyACM0 READ << 75 |
| 86 | +/dev/ttyACM0 READ << 6c74 |
| 87 | +/dev/ttyACM0 READ << 91 |
| 88 | +/dev/ttyACM0 READ << cb40 |
| 89 | +/dev/ttyACM0 READ << 00 |
| 90 | +/dev/ttyACM0 READ << 00 |
| 91 | +/dev/ttyACM0 READ << 0000 |
| 92 | +/dev/ttyACM0 READ << 00 |
| 93 | +/dev/ttyACM0 READ << 0000 |
| 94 | +/dev/ttyACM0 WRITE >> 94 |
| 95 | +/dev/ttyACM0 WRITE >> 01 |
| 96 | +/dev/ttyACM0 WRITE >> 02 |
| 97 | +/dev/ttyACM0 WRITE >> 92 |
| 98 | +/dev/ttyACM0 WRITE >> 01 |
| 99 | +/dev/ttyACM0 WRITE >> b1 |
| 100 | +/dev/ttyACM0 WRITE >> 6d697373696e6720706172616d65746572 |
| 101 | +/dev/ttyACM0 WRITE >> c0 |
| 102 | +=== RUN TestBasicComm/RPCClientCallBoolArgs |
| 103 | +/dev/ttyACM0 READ << 9400 |
| 104 | +/dev/ttyACM0 READ << 03 |
| 105 | +/dev/ttyACM0 READ << a26f |
| 106 | +/dev/ttyACM0 READ << 72 |
| 107 | +/dev/ttyACM0 READ << 92c3 |
| 108 | +/dev/ttyACM0 READ << c2 |
| 109 | +/dev/ttyACM0 WRITE >> 94 |
| 110 | +/dev/ttyACM0 WRITE >> 01 |
| 111 | +/dev/ttyACM0 WRITE >> 03 |
| 112 | +/dev/ttyACM0 WRITE >> c0 |
| 113 | +/dev/ttyACM0 WRITE >> c3 |
| 114 | +/dev/ttyACM0 READ << 9400 |
| 115 | +/dev/ttyACM0 READ << 04 |
| 116 | +/dev/ttyACM0 READ << a26f |
| 117 | +/dev/ttyACM0 READ << 72 |
| 118 | +/dev/ttyACM0 READ << 91 |
| 119 | +/dev/ttyACM0 READ << c2 |
| 120 | +/dev/ttyACM0 WRITE >> 94 |
| 121 | +/dev/ttyACM0 WRITE >> 01 |
| 122 | +/dev/ttyACM0 WRITE >> 04 |
| 123 | +/dev/ttyACM0 WRITE >> c0 |
| 124 | +/dev/ttyACM0 WRITE >> c2 |
| 125 | +/dev/ttyACM0 CLOSE |
| 126 | +--- PASS: TestBasicComm (10.21s) |
| 127 | + --- PASS: TestBasicComm/RPCClientCallFloatArgs (0.03s) |
| 128 | + --- PASS: TestBasicComm/RPCClientCallFloatArgsError (0.03s) |
| 129 | + --- PASS: TestBasicComm/RPCClientCallBoolArgs (0.01s) |
| 130 | +PASS |
| 131 | +ok RpcClientZeroTest 10.216s |
| 132 | +RpcLite/test/RpcClientTest$ |
| 133 | +``` |
0 commit comments