you might say, that if i do not want to get verbose output, i should probably not add the --verbose flag in the first place, but of course things are always more complicated:
the build bots for the Debian project typically try to create verbose logs by default, as this allows a human to gather as much meaningful information as possible by just looking at the logfiles without having to re-run the job
as such I think that running ctest --verbose is actually a good thing
so Debian's build system wrappers actually add this flag automatically :-)
afaiu the reason is really to parse the sofa file (and implicitly check for correctness/inconsistencies). the fact that mysofa2json also outputs a file is just a side-effect which is of no concern to the actual test.
since ctest is run outside a shell context (it's called directly from the buildsystem), we cannot just use add_test(NAME test1 COMMAND ./foo ../test/in.txt > ../test/out.txt) in order to suppress this extra output. one possibility is to wrap the entire function call into a sh invocation, but that's really ugly. a simple -o option to the mysofa2json tool would be much nicer (and people might have an actual use for it :-))
would it be possible to add a
-o <outfile.json>
option tomysofa2json
?i know it is easy enough to just redirect the output to a file (
mysofa2json -c tests/Mesh2HRTF.sofa > x.json
), however:the context of this request is running the test-suite in verbose mode without dumping 200MB of JSON data to the console.
you might say, that if i do not want to get verbose output, i should probably not add the
--verbose
flag in the first place, but of course things are always more complicated:ctest --verbose
is actually a good thingotoh, there are three tests for libmysofa that just call
mysofa2json
: https://github.com/hoene/libmysofa/blob/52494cc8fe05c578a73fe20619375a8cd61e639d/CMakeLists.txt#L56-L61afaiu the reason is really to parse the sofa file (and implicitly check for correctness/inconsistencies). the fact that
mysofa2json
also outputs a file is just a side-effect which is of no concern to the actual test.ctest
is run outside a shell context (it's called directly from the buildsystem), we cannot just useadd_test(NAME test1 COMMAND ./foo ../test/in.txt > ../test/out.txt)
in order to suppress this extra output. one possibility is to wrap the entire function call into ash
invocation, but that's really ugly. a simple-o
option to themysofa2json
tool would be much nicer (and people might have an actual use for it :-))