[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tlf-devel] [dl1jbe/test-travis] moved to cmocka (#7)
From: |
Thomas Beierlein |
Subject: |
Re: [Tlf-devel] [dl1jbe/test-travis] moved to cmocka (#7) |
Date: |
Thu, 1 Feb 2018 21:53:45 +0100 |
Hi Zoli,
Am Thu, 1 Feb 2018 19:30:56 +0100
schrieb Csahok Zoltan <address@hidden>:
> Hi Tom,
>
> Nice to hear that it works well.
> In fact I have applied astyle formatting to the *.c files in test/,
> and thus was assuming that all whitespaces are "correct".
ok, but normally you work incrementally when writing tests and normal
code (e.g. during test driven development). And I fear from time to
time someone overlooks that point.
> Anyway, no problem making the patterns more relaxed.
That would be good.
> Verbose mode is not that trivial. One can execute the script manually
> and check the outputs (run_*.c and defs.am). At least this is much
> faster than a full automake cycle.
>
I see and will give it a try.
In meantime I merged the now working code into my tlf repo dl1jbe/tlf
and will do a pull request to main tlf itself.
What we should think about in the long term is if we want the test code
only as support for development or if we want to distribute it together
with the code. But there is no need to hurry.
73 for now,
Tom DL1JBE
>
> On Thu, Feb 01, 2018 at 06:18:25PM +0100, Thomas Beierlein wrote:
> > Hi Zoli,
> >
> > I did convert some of my old tests to your framework.
> >
> > It works very well and the code is mostly much more clear than in
> > the old version. Excellent work.
> >
> > I found one small problem. Your test_ parser is a little bit picky
> > with regards to whitespaces.
> >
> > void test_aa(void **state)
> >
> > is well, but
> >
> > void test_aa( void **state)
> >
> > does not work at all. As there is also no verbose option it took me
> > some time to find the problem. So maybe you can improve it a little
> > bit to
> > - ignore whitespace in that test_ and setup_ definitions and
> > - have some kind of verbose option for debugging.
> >
> > Anyway, the solution works so well I will bring it back to the main
> > tlf repo shortly. Well done.
> >
> > 73, de Tom DL1JBE
> >
> >
> > Am Wed, 31 Jan 2018 10:23:29 -0800
> > schrieb Zoltan Csahok <address@hidden>:
> >
> > > The setup is as follows
> > > - there are test groups defined in `test_XX.c` files
> > > - each file defines test functions `void test_AA(void **state)`
> > > - each test can have setup/teardown functions (`setup_AA` and
> > > `teardown_AA`) or there can be common (default) s/t functions.
> > > - these are used in `cmocka_unit_test_setup_teardown`
> > > - a test group can have overall s/t funcions, they are used in
> > > `cmocka_run_group_tests`
> > > - a test group specifies which objects it has to be linked with
> > > using `// OBJECT bbb.o` syntax
> > > - for each test group an own runner `run_XX` is generated and
> > > built
> > > - it is linked with `data.c` (global data) and `functions.c`
> > > (common net/hamlib functions)
> > > - wrapping can be added later if needed
> > > - `make check` runs the test groups and reports their result
> > > (PASS/FAIL). The actual logs are in `run_XX.log` files, they
> > > contain detail info on failures. (they are output by the CI jobs)
> > > - if new test groups or test cases are added then an `autoreconf
> > > -i` must be executed
> > >
> > > I've taken over your `scoreTest.c` as `test_score.c`: the change
> > > was minimal, the actual test functions could be used as-is. Also
> > > converted 2 of my basic tests.
> > >
> > > As Ubuntu Trusty used by Travis has a too old cmocka I had to
> > > compile v1.0.1 from sources.
> > >
> > > I think this is quite usable and flexible now.
> > >
> >
> >
> > --
> > "Do what is needful!"
> > Ursula LeGuin: Earthsea
> > --
> >
> >
> > _______________________________________________
> > Tlf-devel mailing list
> > address@hidden
> > https://lists.nongnu.org/mailman/listinfo/tlf-devel
>
> _______________________________________________
> Tlf-devel mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/tlf-devel
--
"Do what is needful!"
Ursula LeGuin: Earthsea
--