test_runners_lib::elf

Trait SuiteServer

Source
pub trait SuiteServer:
    Sized
    + Sync
    + Send {
    // Required methods
    fn run(
        self,
        component: Weak<Component>,
        test_url: &str,
        stream: SuiteRequestStream,
    ) -> AbortHandle;
    fn enumerate_tests<'life0, 'async_trait>(
        &'life0 self,
        test_component: Arc<Component>,
    ) -> Pin<Box<dyn Future<Output = Result<EnumeratedTestCases, EnumerationError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run_tests<'life0, 'life1, 'async_trait>(
        &'life0 self,
        invocations: Vec<Invocation>,
        run_options: RunOptions,
        test_component: Arc<Component>,
        run_listener: &'life1 RunListenerProxy,
    ) -> Pin<Box<dyn Future<Output = Result<(), RunTestError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn get_parallel_count(parallel: u16) -> usize { ... }
    fn serve_test_suite<'async_trait>(
        self,
        stream: SuiteRequestStream,
        component: Weak<Component>,
    ) -> Pin<Box<dyn Future<Output = Result<(), SuiteServerError>> + Send + 'async_trait>>
       where Self: 'async_trait { ... }
}
Expand description

Describes a test suite server for tests that are executed as ELF components.

Required Methods§

Source

fn run( self, component: Weak<Component>, test_url: &str, stream: SuiteRequestStream, ) -> AbortHandle

Run this server.

  • component: Test component instance.
  • test_url: URL of test component.
  • stream: Stream to serve Suite protocol on.

Returns abortable handle for suite server future.

Source

fn enumerate_tests<'life0, 'async_trait>( &'life0 self, test_component: Arc<Component>, ) -> Pin<Box<dyn Future<Output = Result<EnumeratedTestCases, EnumerationError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Retrieves test information from the test binary.

A cached list of test cases should be returned by cloning a SharedFuture<EnumeratedTestCases, EnumerationError> that is stored in the suite server struct.

Source

fn run_tests<'life0, 'life1, 'async_trait>( &'life0 self, invocations: Vec<Invocation>, run_options: RunOptions, test_component: Arc<Component>, run_listener: &'life1 RunListenerProxy, ) -> Pin<Box<dyn Future<Output = Result<(), RunTestError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Runs requested tests and sends test events to the given listener.

Provided Methods§

Source

fn get_parallel_count(parallel: u16) -> usize

Source

fn serve_test_suite<'async_trait>( self, stream: SuiteRequestStream, component: Weak<Component>, ) -> Pin<Box<dyn Future<Output = Result<(), SuiteServerError>> + Send + 'async_trait>>
where Self: 'async_trait,

Implements fuchsia.test.Suite service and runs test.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§