[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling/disabling tests by command line parameters

On Thursday 28 January 2016 13:10:46 Pavel Kretov wrote:
> > Jakub and I already wanted to do that but time didn't permit it
> > yet. FOSDEM is ahead and we worked on getting pam_wrapper out before
> > FOSDEM so we can do a presentation.
> Good luck with meeting your deadline and preparing presentation! This
> task doesn't seem to be time-critical. I'll try to help you with
> implementing this feature when you're done with FOSDEM.
> > We discussed it the way that we create a function named e.g.
> > 
> > cmocka_set_test_filter()
> > 
> > In the internal test structure we add a new struct member called enabled.
> > Based an what is set in the filter we enable or disable the tests to run.
> In fact, I'd prefer a solution without global state. But if it's the
> way you see your library design, I'm not going to argue a lot. Maybe
> it's worth to rise this question again when it comes to releasing new
> major version? A bit of re-designing and removing deprecated items may
> be a good idea to me.

cmocka_run_group_tests() needs to do the work, while creating the internal 
structure it needs to set the test to disabled. We do not want to break the 
API so this is the option.

We might break the API in future but not now!

> > We will not do command line argument parsing as this is different on each
> > platform (Linux, BSD, Windows, embedded platforms) (popt, argp, ...).
> I think option parsing can be done in a crossplatform manner by manual
> parsing argv. If the platform is so embedded that it has no argv,
> unused parsing function will be just stripped out by linker anyway.

Feel free to suggest a patch for that!

> > Writing a simple pattern matching function which supports * and ? is not
> > hard to do (~50 loc).
> As well as writing simple command line parser :). The problem
> with * and ? is that they're special to Bash. But, unfortunately,
> I don't know better alternatives yet.

That shouldn't be a big problem :)


	-- andreas

Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                asn@xxxxxxxxxxxxxx