Open robnagler opened 6 years ago
@robnagler It's up to you, but the proposed approach would either make the process appear as 1 test to CTest, or be completely outside of CTest. This is fine, but CTest has some nice bells and whistles that you won't be getting if you use a shell script test harness like this.
Currently, we could easily implement an analogous solution with CTest. We can populate a directory in the build tree or source tree called full_data
with .res
files, then copy them to full_work/zgoubi.dat
.
Current impediments to this approach are:
PARIZ.H
and recompile the binary depending on the test inputwarmsnake.map
Modernizing zgoubi to use dynamic memory allocation will fix the first issue. I'm not sure how many tests require additional files beyond zgoubi.dat
, so I can't speak to the difficulty of solving the second point. @dtabell may be able to weigh in here.
Reading @robnagler's comment here I think it might make more sense to create one directory per test in the full_work
directory, so that we can see all the inputs and outputs, rather than running all the tests in the same directory. (Also easily accomplished with CMake.)
What are the bells and whistles of CTest?
CTest has quite a long list of features, however the most immediately beneficial and useful (also, CTest was explicitly part of the SOW1) are:
FindMPI
module abstracts away this giant headache.)DATA{...}
statements from CMake's ExternalData module.
Zgoubi has a nice feature that it can read a .res file to get the .dat used to generate it. We can use his feature to build as simple test harness called full_test.sh:
We can then add any *.res files in full_work, and they'll be copied to full_data one by one until one fails, and the test will exit without a PASS.
Per @dtabell's suggestion we should probably use ndiff or the newer numdiff.