| 1 | # Tests |
| 2 | |
| 3 | ## License |
| 4 | |
| 5 | Test programs of this directory are provided under BSD license (see associated |
| 6 | LICENSE file). |
| 7 | |
| 8 | ## Compilation |
| 9 | |
| 10 | After installation, you can use pkg-config to compile these tests. |
| 11 | For example, to compile random-test-server run: |
| 12 | |
| 13 | `gcc random-test-server.c -o random-test-server $(pkg-config --libs --cflags libmodbus)` |
| 14 | |
| 15 | - `random-test-server` is necessary to launch a server before running |
| 16 | random-test-client. By default, it receives and replies to Modbus query on the |
| 17 | localhost and port 1502. |
| 18 | |
| 19 | - `random-test-client` sends many different queries to a large range of |
| 20 | addresses and values to test the communication between the client and the |
| 21 | server. |
| 22 | |
| 23 | - `unit-test-server` and `unit-test-client` run a full unit test suite. These |
| 24 | programs are essential to test the Modbus protocol implementation and libmodbus |
| 25 | behavior. |
| 26 | |
| 27 | - `bandwidth-server-one`, `bandwidth-server-many-up` and `bandwidth-client` |
| 28 | return very useful information about the performance of transfer rate between |
| 29 | the server and the client. `bandwidth-server-one` can only handles one |
| 30 | connection at once with a client whereas `bandwidth-server-many-up` opens a |
| 31 | connection for each new clients (with a limit). |