Skip to content

Test NifStruct derived traits #566

@alexkaf

Description

@alexkaf

Hello all, I have the following struct created in order to bridge an Elixir struct with my NIF:

#[derive(NifStruct)]
#[module = "ElixirStruct"]
struct RustStruct {
   s1: String,
   s2: String
}

All good so far, and my NIF successfully uses this Elixir struct. However, the problem comes in my code test coverage (I use llvm-cov tool) where I cannot reach 100% since I can't to test Decode and Encode trait functions derived from NifStruct. I find some trouble creating a custom Env in my tests in order to test these functions (not sure if it is possible).

Is there a way to either ignore these trait definitions (probably an llvm-cov issue but still didn't find a way to do so) or even better create tests to cover these lines as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions