You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: lib.rs
    path of file: ./repos/mullvadvpn-app/test/test-manager/test_macro/src
    
    the code of the file until where you have to start completion: use proc_macro::TokenStream;
use quote::{quote, ToTokens};
use syn::{AttributeArgs, Lit, Meta, NestedMeta};

/// Register an `async` function to be run by `test-manager`.
///
/// The `test_function` macro will inject two arguments to your function:
///
/// * `rpc` - a [`test_rpc::client::ServiceClient]` used to make
/// remote-procedure calls inside the virtual machine running the test. This can
/// be used to perform arbitrary network requests, inspect the local file
/// system, rebooting ..
///
/// * `mullvad_client` - a [`mullvad_management_interface::MullvadProxyClient`]
/// which provides a bi-directional communication channel with the
/// `mullvad-daemon` running inside of the virtual machine. All RPC-calls as
/// defined in [`mullvad_management_interface::MullvadProxyClient`] are
/// available on `mullvad_client`.
///
///# Arguments
///
/// The `test_function` macro takes 4 optional arguments
///
/// * `priority` - The order in which tests will be run where low numbers run
/// before high numbers and tests with the same number run in undefined order.
/// `priority` defaults to 0.
///
/// * `cleanup` - If the cleanup function will run after the test is finished
/// and among other things reset the settings to the default value for the
/// daemon.
/// `cleanup` defaults to true.
///
/// * `must_succeed` - If the testing suite stops running if this test fails.
/// `must_succeed` defaults to false.
///
/// * `always_run` - If the test should always run regardless of what test
/// filters are provided by the user.
/// `always_run` defaults to false.
///
/// * `target_os` - The test should only run on the specified OS.
    
fn create_test(test_function: TestFunction) -> proc_macro2::TokenStream {
    let test_function_priority = match test_function.macro_parameters.priority {
        Some(priority) => quote! { Some(#priority) },
        None => quote! { None },
    };
    let target_os = match test_function.macro_parameters.target_os {
        Some(target_os) => {
            quote! {
                Some(::std::str::FromStr::from_str(#target_os).expect("invalid target os"))
            }
        }
        None => quote! { None },
    };
    let should_cleanup = test_function.macro_parameters.cleanup;
    let always_run = test_function.macro_parameters.always_run;
    let must_succeed = test_function.macro_parameters.must_succeed;

    let func_name = test_function.name;
    let function_mullvad_version = test_function.function_parameters.mullvad_client.version();
    let wrapper_closure = match test_function.function_parameters.mullvad_client {
        MullvadClient::New {
            mullvad_client_type,
            ..
        } => {
            let mullvad_client_type = *mullvad_client_type;
            quote! {
                |test_context: crate::tests::TestContext,
                rpc: test_rpc::ServiceClient,
                mullvad_client: Box<dyn std::any::Any + Send>,|
                {
                    use std::any::Any;
                    let mullvad_client = mullvad_client.downcast::<#mullvad_client_type>().expect("invalid mullvad client");
                    Box::pin(async move {
                        #func_name(test_context, rpc, *mullvad_client).await
                    })
                }
            }
        }
        MullvadClient::None { .. } => {
            quote! {
                |test_context: crate::tests::TestContext,
                rpc: test_rpc::ServiceClient,
                mullvad_client: Box<dyn std::any::Any + Send>| {
                    Box::pin(async move {
                        #func_name(test_context, rpc).await
                    })
                }
            }
        }
    };

    quote! {
        inventory::submit!(crate::tests::test_metadata::TestMetadata {
            name: stringify!(#func_name),
            command: stringify!(#func_name),
            target_os: #target_os,
            mullvad_client_version: #function_mullvad_version,
            func: Box::new(#wrapper_closure),
            priority: #test_function_priority,
            always_run: #always_run,
            must_succeed: #must_succeed,
            cleanup: #should_cleanup,
        });
    }
}