Typically I'll use one of two strategies when using Check for my projects
to unit test:
- the code under test involves no or minimal global state, and using Check
directly without mocks is OK.
- if mocking is necessary, I'll create some stub libraries that link
against the test programs; these libraries are the mocking.
It may be that cmocha handles the linking itself to provide a mocking
interface. Check does not support this, though it may be nice if it did.
- Branden
On Fri, Mar 25, 2016 at 9:05 PM, Chris Pickett <chr...@ma...
> wrote:
> Hi David,
>
> I think probably you didn't get a reply because nobody knows. If you're
> able to do it with a significant amount of work, that is probably the
> best you can hope for with Check. If there are improvements to Check
> you can think of that would make mocking easier, contributions are
> welcome. Sorry I can't be of more assistance here.
>
> Chris
>
> do...@ma... wrote:
> > Hello,
> > It's been almost 2 weeks since I asked on check-users so I'm passing it
> > on to you.
> > I began using check in my own project and I intend to contribute
> > to the uzbl browser on gihub. I have a problem though, up until now I've
> > used mockups when working with my project as it is pretty basic, but when
> > working on something that uses webkit, glib, gtk , and a lot of global
> > information passing via structs I find that significant effort is needed
> > to create the mockups (I've mocked-up everything but glib so far, which
> > I don't think I'll (be able to), do).
> > I wanted to know if you fellows do the same or what?
> > I thought I might try a different framework, like cmocka, but I could not
> > understand their framework. I also must confess that I like yours a lot.
> > I did read the docs, but they and the money examples provide no answer,
> > or at least I did not notice any answer.
> >
> > Thanks, David
> >
> >
> ------------------------------------------------------------------------------
> > Transform Data into Opportunity.
> > Accelerate data analysis in your applications with
> > Intel Data Analytics Acceleration Library.
> > Click to learn more.
> > http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> > _______________________________________________
> > Check-devel mailing list
> > Che...@li...
> > https://lists.sourceforge.net/lists/listinfo/check-devel
>
>
> ------------------------------------------------------------------------------
> Transform Data into Opportunity.
> Accelerate data analysis in your applications with
> Intel Data Analytics Acceleration Library.
> Click to learn more.
> http://pubads.g.doubleclick.net/gampad/clk?id=278785351&iu=/4140
> _______________________________________________
> Check-devel mailing list
> Che...@li...
> https://lists.sourceforge.net/lists/listinfo/check-devel
>
|