Commit Graph

2 Commits

Author SHA1 Message Date
Stefano Garzarella
5847489855 vsock: increase test coverage
Add more tests in vhost-device-vsock to increase the coverage.

Some of them are really simple and perhaps nonsensical (tests for
Debug, Clone, etc.), but for now we don't know how to disable this
in the tool, so let's cover these cases.

The vhost-device-vsock functions coverage increases from 70.73% to
90.45%:
    Filename             Functions  Missed Functions  Executed
    ----------------------------------------------------------
    main.rs                     51                12    76.47%
    rxops.rs                     8                 0   100.00%
    rxqueue.rs                  20                 0   100.00%
    thread_backend.rs           20                 3    85.00%
    txbuf.rs                    17                 0   100.00%
    vhu_vsock.rs                37                 1    97.30%
    vhu_vsock_thread.rs         40                 5    87.50%
    vsock_conn.rs               27                 0   100.00%
    ----------------------------------------------------------
    TOTAL                      220                21    90.45%

Closes #229

Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
2023-11-08 12:34:12 +02:00
Manos Pitsidianakis
a1e013286f Move all crates to workspace root
Having all the workspace crates under the crates/ directory is
unnecessary. Rust documentation itself recommends all crates to be in
the root directory:

https://doc.rust-lang.org/book/ch14-03-cargo-workspaces.html#creating-the-second-package-in-the-workspace

I paste the text content here, in case the online page ever changes or
becomes unavailable:

    ## Creating the Second Package in the Workspace

    Next, let’s create another member package in the workspace and call it add_one. Change the top-level Cargo.toml to specify the add_one path in the members list:

    Filename: Cargo.toml

    [workspace]

    members = [
        "adder",
        "add_one",
    ]

    Then generate a new library crate named add_one:

    $ cargo new add_one --lib
         Created library `add_one` package

    Your add directory should now have these directories and files:

    ├── Cargo.lock
    ├── Cargo.toml
    ├── add_one
    │   ├── Cargo.toml
    │   └── src
    │       └── lib.rs
    ├── adder
    │   ├── Cargo.toml
    │   └── src
    │       └── main.rs
    └── target

Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
2023-10-16 12:03:57 +05:30