Kinda.Testing.NIFUpgrade (kinda v0.12.0)

Copy Markdown View Source

Test support for loading a second copy of a NIF into an existing module.

The copied library keeps the same native entry name; the distinct path only gives the dynamic loader a second image to pass through the NIF upgrade callback. Use the separate kinda_sandbox package when the entry name itself must differ.

Summary

Types

snapshot()

@type snapshot() :: %Kinda.Testing.NIFUpgrade.Snapshot{
  binary: binary(),
  module: module(),
  path: charlist()
}

Functions

copy_library!(application, library, directory, options \\ [])

@spec copy_library!(atom(), String.t(), Path.t(), keyword()) :: Path.t()

load!(module, nif_file)

@spec load!(module(), Path.t()) :: {:module, module(), binary(), term()}

remember!(module)

@spec remember!(module()) :: snapshot()

restore!(snapshot)

@spec restore!(snapshot()) :: :ok

run!(module, application, library, directory, scenario)

@spec run!(module(), atom(), String.t(), Path.t(), (-> result)) :: result
when result: term()