aboutsummaryrefslogtreecommitdiff
path: root/test/CMakeLists.txt
AgeCommit message (Collapse)AuthorFilesLines
2021-03-25re-work unit test mocking (#400)John Levon1-22/+2
Instead of trying to use the linker's --wrap, which just led to more problems when we want to call the real function, we'll add two defines, MOCK_DEFINE() and MOCK_DECLARE(), that behave differently when building the unit tests, such that all wrapped functions are picked up from test/mocks.c instead, regardless of compilation unit. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-03-01don't call user's unmap_dma callback when removing DMA region (#370)Thanos Makatos1-0/+1
Plus unit tests. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reported-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-03-01run unit tests under valgrind too (#358)John Levon1-1/+11
If we're not running ASAN, use valgrind. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-02-18unit test exec_command and friends w.r.t. migration device state (#346)Thanos Makatos1-0/+4
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-02-18drop -Wno-implicit-function-declaration from unit tests (#349)Thanos Makatos1-2/+0
This might cause undefined program behavior. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: John Levon <john.levon@nutanix.com>
2021-02-17add unit tests for handle dirty pages w/o DMA (#348)Thanos Makatos1-0/+1
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-02-10expose migration region (#305)Thanos Makatos1-0/+2
This patch exposes the fact that live migration is implemented as a special device region. Hiding this from the user doesn't offer much benefit since it only takes just a little bit of extra code for the user to handle it as a region. We do keep the migration callback functionality since this feature substantially simplifies supporting live migration from the device implementation's perspective. Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com> Co-authored-by: John Levon <john.levon@nutanix.com>
2021-02-05use tran_sock_*() namespace (#308)John Levon1-1/+1
Rename (again!) all internal tran_sock APIs so it's very clear which cases are directly using them, perhaps when they shouldn't. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-02-01run client/server sample in CI (#274)Thanos Makatos1-0/+1
run client/server sample in CI Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2021-01-20support extended capabilities (#226)John Levon1-0/+1
Provide initial support for extended capabilities, and implement handlers for the Device Serial Number and Vendor-Specific capabilities. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2021-01-20re-work API for adding capabilities (#200)John Levon1-1/+1
Allow to add capabilities individually, including extended capabilities, and those to be handled via the region callback. As a side effect, rework config space accesses to handle reads that straddle capabilities and non-standard areas and use callbacks as needed. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-10Drop vfu_ctx_drive() and use vfu_ctx_poll() (#178)swapnili1-0/+1
* Drop vfu_ctx_drive() and use vfu_run_ctx() Renamed vfu_ctx_poll() to vfu_run_ctx(). Updated vfu_run_ctx() to also handle blocking ctx. Instead of having separate functions for blocking and non-blocking ctx, better to have one. This way user can call same set of functions for both cases. Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-12-01don't leak passed file descriptors on failureThanos Makatos1-0/+6
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27rename to libvfio-user (#128)John Levon1-5/+5
The muser name no longer reflects the implementation, and will just serve to confuse. Bite the bullet now, and rename ourselves to reflect the actual implementation. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com> Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
2020-11-27fix test build (#132)John Levon1-7/+13
Some cmake versions don't handle backslashes well; use more specific facilities to add the compile and link flags. Signed-off-by: John Levon <john.levon@nutanix.com> Reviewed-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-27add unit tests for DMA regions without file descriptorThanos Makatos1-2/+14
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
2020-11-25add "make test"; run it in pre-commit (#127)John Levon1-2/+5
Also rename test.c to reflect it should cover unit tests. Reviewed-by: Swapnil Ingle <swapnil.ingle@nutanix.com> Signed-off-by: John Levon <john.levon@nutanix.com>
2020-11-25introduce cmocka unit test framework and first unit testThanos Makatos1-0/+30
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>