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: runner.rs
    path of file: ./repos/gdext/itest/rust/src/framework
    
    the code of the file until where you have to start completion: /*
 * Copyright (c) godot-rust; Bromeon and contributors.
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

use std::time::{Duration, Instant};

use godot::builtin::meta::ToGodot;
use godot::builtin::{Array, GString, Variant, VariantArray};
use godot::en
    
    fn run_gdscript_tests(&mut self, tests: VariantArray) -> Duration {
        let mut last_file = None;
        let mut extra_duration = Duration::new(0, 0);

        for test in tests.iter_shared() {
            let test_file = get_property(&test, "suite_name");
            let test_case = get_property(&test, "method_name");

            print_test_pre(&test_case, test_file.clone(), &mut last_file, true);

            // If GDScript invokes Rust code that fails, the panic would break through; catch it.
            // TODO(bromeon): use try_call() once available.
            let result = std::panic::catch_unwind(|| test.call("run", &[]));

            // In case a test needs to disable error messages, to ensure it runs properly.
            Engine::singleton().set_print_error_messages(true);

            if let Some(duration) = get_execution_time(&test) {
                extra_duration += duration;
            }

            let outcome = match result {
                Ok(result) => {
                    let success = result.try_to::<bool>().unwrap_or_else(|_| {
                        // Not a failing test, but an error in the test setup.
                        panic!("GDScript test case {test} returned non-bool: {result}")
                    });

                    for error in get_errors(&test).iter_shared() {
                        godot_error!("{error}");
                    }
                    TestOutcome::from_bool(success)
                }
                Err(e) => {
                    // TODO(bromeon) should this be a fatal error, i.e. panicking and aborting tests -> bad test setup?
                    // If GDScript receives panics, this can also happen in user code that is _not_ invoked from Rust, and thus a panic
                    // could not be caught, causing UB at the Godot FFI boundary (in practice, this will be a defined Godot crash with
                    // stack trace though).
                    godot_error!("GDScript test panicked");
                    godot::private::extract_panic_message(e);
                    TestOutcome::Failed
                }
            };

            self.update_stats(&outcome, &test_file, &test_case);
            print_test_post(&test_case, outcome);
        }
        extra_duration
    }