I have learnt how to use ctest with add_test("base64 conversion" utils.exe) e.g. I would like to know if there is a common pattern to perform several tests with the same executable. I have a util component that does many things, for example base64 encoding, base64 decoding, base85 encoding, base85 decoding, own timer testing. So classes are Base64, Base85, Timer, ...
add_test(base64_encoding utils base64_encoding)
add_test(base64_decoding utils base64_decoding)
add_test(base85_encoding utils base85_encoding)
add_test(base85_decoding utils base85_decoding)
add_test(timer_create utils timer_create)
add_test(timer_set_timeout utils timer_set_timeout)
This is a way to pass-in the testname to be executed as args, and in utils.exe I can get the argv[1] and perform a string compare to know which test to run. It looks to be a bit ugly, and creating one executable target per test seems also ugly because I have too many classes in my utils, and for each family something like 100 unit tests. Is there a magic way to organize all of this please? many thanks