linkrope / dunit

xUnit Testing Framework for D

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support of SkipIf

andre2007 opened this issue · comments

What do you think about supporting SkipIf

struct SkipIf
{
    bool delegate() b; // or just "bool b" for only allowing compile time arguments?
    string reason;
}

class GetDirectionalDerivativeTest
{
    mixin UnitTest;
	
	@Test
    @SkipIf(() => !platform.among("win32", "win64"), "Platform not supported")
	void test_get_directional_derivative()
	{
    }
}

Actually there is a DIP https://github.com/dlang/DIPs/blob/master/DIPs/DIP1033.md which would allow to write it like this:

@SkipIf(!platform.among("win32", "win64"), "Current platform not supported by this FMU")

Other use case: skipping a test based on environment variables like in this python example:

https://github.com/CATIA-Systems/FMPy/blob/a2c62367ebf57c9bcabd6f036636588f563502d4/tests/test_fmi3.py#L10

Fixed