NOAA-EMC / NCEPLIBS-bufr

The NCEPLIBS-bufr library contains routines and utilites for working with the WMO BUFR format.
Other
44 stars 19 forks source link

can't test sinv utility with one argument via ctest #392

Open jbathegit opened 1 year ago

jbathegit commented 1 year ago

The sinv utility can be called with either one argument or two. The first argument is always the BUFR file to be read, and the second one is optional containing the directory location of the master tables. If the user only passes in one argument, then the utility defaults to the directory location of the master tables when the library was installed.

The problem is that, when doing a build, we always run "ctest" before we run "make install", and the latter step is where the master tables actually get installed into their default directory location, so they're not available there when "ctest" is run, and therefore we can't test calling the sinv utility with only one argument in test/testscripts/test_sinv.sh. I've noted this in a comment in that script, and for now it means we won't be able to achieve 100% gcovr testing coverage of the sinv source code.

BTW, and once "make install" is run, then the sinv utility can be called with just one argument and it works correctly. Again, we just can't include this as a test case when we run "ctest", since the "make install" hasn't occurred yet.

edwardhartnett commented 1 year ago

I believe we will just live with this, at least until we achieve a much higher level of testing elsewhere. I think you can close this issue.

jbathegit commented 1 year ago

Thanks, but I'd like to leave it open, just to help us remember that this does need to be addressed at some point.

edwardhartnett commented 8 months ago

Well I don't think there is any solution to this except to change sinv so that it can read some initialization file to find the location of the master tables. If so such sinv intialization file is available, then it defaults to the usual location of the master tables.

Then, for testing, you have the sinv initialization file present, and have it point to master tables in your test directory. These can be used to fully test sinv before make install. Then, you install, but you don't install the sinv initialization file. Now sinv will always look for the master tables in the default location.

Just a thought...