EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Unit testing IOCs and databases
From: "Johnson, Andrew N. via Tech-talk" <tech-talk at aps.anl.gov>
To: Stainer Tom <Tom.Stainer at sckcen.be>
Cc: EPICS tech-talk <tech-talk at aps.anl.gov>
Date: Tue, 7 Sep 2021 15:39:29 +0000
Hi Tom,

On Sep 7, 2021, at 6:19 AM, Stainer Tom via Tech-talk <tech-talk at aps.anl.gov> wrote:

With regard to base tests, I have indeed tried writing unit tests with the epicsUnitTest.h but one quirk I could not understand is why I have to count up all the asserts and add that number to the testPlan as an argument.
Do people run a script to count them or do you simply run it once to fail and then use that number?
It wasn’t a big issue, it is just a bit more overhead compared to other testing libraries.

This is covered in the documentation/Doxygen annotation comments.

Providing the test count is optional, but it’s there so the harness can detect if the test program crashes before it has completed all of the tests. During test program development you can call testPlan(0) at the start and everything will work just fine, but we recommend that you fill in the count once you’ve finished adding tests or you can miss out on the check that it did actually run all of them. This also encourages you to ensure that every test reports a single pass or fail result

An old parser for the TAP format for the Jenkins CI software didn’t originally check the count at all, and we had several occasions where a test seg-faulted on one architecture but the job passed because the parser didn’t realize there was a problem. 

HTH,

- Andrew

-- 
Complexity comes for free, simplicity you have to work for.


References:
Unit testing IOCs and databases Stainer Tom via Tech-talk
Re: Unit testing IOCs and databases Ralph Lange via Tech-talk
RE: Unit testing IOCs and databases Stainer Tom via Tech-talk

Navigate by Date:
Prev: RE: Unit testing IOCs and databases Freddie Akeroyd - STFC UKRI via Tech-talk
Next: Re: Data acquisition storage retrieval, post analysis and visualization. J. Lewis Muir via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
Navigate by Thread:
Prev: Re: Unit testing IOCs and databases Simon Rose via Tech-talk
Next: Re: Unit testing IOCs and databases Torsten Bögershausen via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024 
ANJ, 07 Sep 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·