bvdberg / ctest

ctest is a unit test framework for software written in C.
http://bvdberg.github.io/ctest/
Apache License 2.0
230 stars 91 forks source link

redefine vsprintf in a nice way #44

Open nicola-lunghi opened 4 years ago

nicola-lunghi commented 4 years ago

Hi,

first, thank you for this project is really nice!!!!

I have a couple of questions:

1) there's a "nice way" without changing the ctest.h header to redefine the vsnprintf function? in my system I have to use a specific test_msg() function (for various reasons) to report text messages to the system so I cannot use any "printf" function. how can I extend ctest to use custom printf functions?

2) Also I have another function test_results() to report results to the main test framework. there's a way to call a user function to report test results for the single test? how will you handle this?

3) how can I define different test suites and skip/execute those depending on a "configuration":

for example I can have

suite1 suite2 suite3

configuration1 -> execute 1, skip 2 and 3 configuration2 -> execute 1, skip 2 execute 3 configuration3 -> execute 1, 2 and 3

switch(test_configuration) case NO_STRESS_TEST result = ctest_main(configuration1) case TEST_ALL result = ctest_main(configuration3)

bvdberg commented 4 years ago

There is no real nice way. There is a CTEST_SKIP() version that skips tests, but you would have to wrap that in macros of your own..