test: refactor common code into BaseTest

Refactor test code into a BaseTest class with common code. Also change
the test logic to create a separate thread for modbus test server so it
can run independent of client.

Tested -
```
> meson test -t 10 -C builddir/ --print-errorlogs --wrapper="valgrind --error-exitcode=1"
ninja: Entering directory `/host/repos/Modbus/phosphor-modbus/builddir'
ninja: no work to do.
1/7 test_modbus_commands        OK               0.73s
2/7 test_firmware               OK               3.52s
3/7 test_inventory              OK               5.67s
4/7 test_modbus                 OK               7.91s
5/7 test_events                 OK               9.55s
6/7 test_port                   OK              12.06s
7/7 test_sensors                OK              16.35s

Ok:                7
Fail:              0
```

Change-Id: I7324494caf641a49f6ad345b09c0942daad0a46f
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
10 files changed
tree: d3bc846d836e8d3941c2d1483f6b3adb66032fdf
  1. common/
  2. mocked_test_device/
  3. rtu/
  4. subprojects/
  5. tests/
  6. .clang-format
  7. .clang-tidy
  8. .gitignore
  9. LICENSE
  10. meson.build
  11. meson.options
  12. OWNERS
  13. README.md
README.md

phosphor-modbus

phosphor-modbus provides a set of software applications to query sensors info, inventory data, firmware info of various modbus devices.

Dependencies

The phosphor-modbus requires phosphor-dbus-interfaces, sdbusplus and phosphor-logging.

Building

The phosphor-modbus is built using meson.

meson build && ninja -C build