protostar icon indicating copy to clipboard operation
protostar copied to clipboard

Add support for `setup`s

Open Arcticae opened this issue 1 year ago • 4 comments

Arcticae avatar Feb 27 '23 11:02 Arcticae

Moving it to protostar 1.0, it is not related to pure cairo1 runner

MaksymilianDemitraszek avatar Feb 28 '23 10:02 MaksymilianDemitraszek

This should be considered when implementing https://github.com/software-mansion/protostar/issues/1322

MaksymilianDemitraszek avatar Apr 24 '23 17:04 MaksymilianDemitraszek

Suggested syntax

#[setup]
fn some_func(){
}

We should use compilers config attributes feature for thath

MaksymilianDemitraszek avatar May 16 '23 10:05 MaksymilianDemitraszek

Mabye it is alsow worth considering, rust setup

use std::sync::Once;

static INIT: Once = Once::new();

pub fn initialize() {
    INIT.call_once(|| {
        // initialization code here
    });
}

I firmly believe this issue deserves a design doc before hand

Useful resource https://docs.swmansion.com/protostar/docs/legacy/testing#setup-hooks

MaksymilianDemitraszek avatar May 18 '23 08:05 MaksymilianDemitraszek