tlf-devel
[Top][All Lists]
Advanced

[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 18:18:25 +0100

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
--




reply via email to

[Prev in Thread] Current Thread [Next in Thread]