Hi Tom, I have checked your approach. I think the following combination of both could work - one test harness like my run.c + the (generated, if poss) test defs - global data (mostly from src/main.c) in a global.c - functions that use network/hamlib/curses mocked/wrapped in global.c - per file test files (test_xxx.c), each with init/clean as needed * there shouldn't be any interference between tests as long as they set up everything they need * a file tests the "public" functions defined in the corresponding .h file - all used objects are linked from src * no compilation is needed and * they are used as they are present in tlf executable - Makefile.am is used to set the right libs for linking * mainly needed for glib (I didn't need this unil now)
Will make a prototype in test-travis to see if the above is feasible. 73, Zoli On Sun, Jan 28, 2018 at 04:35:53PM +0100, Thomas Beierlein wrote: > Hi Zoli, > > I just pushed my own 'tests' branch which I mentioned yesterday to > > https://github.com/dl1jbe/tlf/tree/tests > > I uses cmocka-1.1.1 as test framework. It needs to be installed by hand > before, as I did not integrate the check for it into configure.ac > until now. > > Maybe we can integrate both our test setups. > > > By the way I like your idea with the automatic generation of "defs.h" > and the Makefile on the fly. I fear it will only work for tests where > the code under test is located in one c-file only. There is still a lot > of code which is tightly coupled and needs to compile in more than one > file and stub out quite some other functions too (see my code). > > One of my goals is to reduce that coupling to make testing easier. > > 73, de Tom DL1JBE > > > Am Fri, 26 Jan 2018 20:31:00 +0100 > schrieb Csahok Zoltan <ha5...@freemail.hu>: > > > Tom, cloned your repo and Travis CI works quite well. > > I'll try to add a CUnit test as per docs. Not all of Tlf > > can be tested that way, but let's see how far we can get. > > > > The .astylerc you shared looks OK to me. > > (yes, I meant indent of 4 spaces) > > > > 73, > > Zoli > > > > > > On Fri, Jan 26, 2018 at 02:42:41PM +0100, Thomas Beierlein wrote: > > > That repo was only set up as a playground to test the features of > > > travis-ci - not for real tlf development. > > > > > > 73, de Tom > > > > _______________________________________________ > > Tlf-devel mailing list > > Tlf-devel@nongnu.org > > https://lists.nongnu.org/mailman/listinfo/tlf-devel > > > > -- > "Do what is needful!" > Ursula LeGuin: Earthsea > -- > > > _______________________________________________ > Tlf-devel mailing list > Tlf-devel@nongnu.org > https://lists.nongnu.org/mailman/listinfo/tlf-devel _______________________________________________ Tlf-devel mailing list Tlf-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tlf-devel